Html 在引导框架中禁用触摸设备的缩放
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20675107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Disable zooming for touch devices in bootstrap framework
提问by Dipen Dedania
I am using twitter bootstrapframework. I want to disable zooming in touch devices. I have already used
我正在使用Twitter 引导程序框架。我想禁用放大触摸设备。我已经用过
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
this. Without bootstrap framework and i can prevent zooming in touch devices, but with framework i'm not. So is there any workarounds to do that.
这个。没有引导框架,我可以防止放大触摸设备,但没有框架我不能。那么是否有任何解决方法可以做到这一点。
Thanks in advance.
提前致谢。
采纳答案by Dipen Dedania
Guys thanks for the answers. Actually it was my silly mistake. I had a multiple meta's in the page and it was causing the problem. Below code should work for all.
伙计们感谢您的答案。其实这是我的愚蠢错误。我在页面中有多个元,它导致了问题。下面的代码应该适用于所有人。
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
回答by Ankit Kothari
Write Following code that will disable the mobile zoom disable andy also disable for focus on the any input type
编写以下代码将禁用移动缩放禁用并且还禁用聚焦于任何输入类型
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
回答by jmosawy
If you look at Bootstrap documentation, they have said that in order to disable zooming, you must include the following meta tag between opened and closed head tags:
如果您查看 Bootstrap 文档,他们会说为了禁用缩放,您必须在打开和关闭的 head 标记之间包含以下元标记:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
回答by Mehdi Shahamirian
As other guys mentioned and also you can find in Bootstrap documentation at http://getbootstrap.com/css/#overview-mobilehere is the solution
正如其他人提到的,你也可以在http://getbootstrap.com/css/#overview-mobile 的Bootstrap 文档中找到这里是解决方案
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">