防止iPhone缩放形式? [英] Prevent iPhone from zooming form?

查看:105
本文介绍了防止iPhone缩放形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码:

 < select> 
< option value =1>主页< / option>
< option value =2>关于< / option>
< option value =3>服务< / option>
< option value =4>联络< / option>
< / select>

当我触摸选择时,iPhone变焦在那个元素中(并且在取消选择后不缩小)。



我该如何防止这种情况发生?或缩小回来?我不能使用 user-scalable = no ,因为我实际上需要这个功能。这是iPhone的选择菜单。

这种方法不再适用






它取决于视口,您可以通过这种方式禁用它:

 < meta name =viewportcontent =width = device-width,initial-scale = 1,maximum-scale = 1,user-scalable = 0\" /> 

add user-scalable = 0 应该在你的投入上工作。


The code:

<select>
    <option value="1">Home</option>
    <option value="2">About</option>
    <option value="3">Services</option>
    <option value="4">Contact</option>
</select>

When I touch select, the iPhone zooms in that element (and does not zoom out after deselecting).

How can I prevent this? Or zoom back out? I can't use user-scalable=no because I actually need that functionality. It's for iPhone, select menu.

解决方案

UPDATE: This method no longer works on iOS 10.


It depend from the Viewport, you can disable it in this way:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>

add user-scalable=0 and it should work on your inputs as well.

这篇关于防止iPhone缩放形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆