开发者

android and webos no content scaling?

开发者 https://www.devze.com 2023-01-29 13:38 出处:网络
I am currently building a website optimized for mobile devices. 开发者_Python百科<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalabl

I am currently building a website optimized for mobile devices.

开发者_Python百科
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

I have a dynamic javascript grid and i want no scaling on mobile devices.

The line above works perfectly on the iphone, however I think it does not work on android or webos. How can I set a NO-SCALE mode for those mobile devices as well. So there is no pinch & zoom and the device-width is the 100% browser-width?


According to http://developer.android.com/guide/webapps/targeting.html#Metadata, the "user-scalable" property needs to be set to "no", not 0. So:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;"/>

EDIT: A bit more info near the bottom of the page at Safari Reference Library - Supported Meta Tags:

user-scalable
Determines whether or not the user can zoom in and out—whether or not the user can change the scale of the viewport. Set to yes to allow scaling and no to disallow scaling. The default is yes.

Setting user-scalable to no also prevents a webpage from scrolling when entering text in an input field.

Available in iOS 1.0 and later.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号