android 和 webos 没有内容缩放吗?

发布于 2024-10-06 21:43:44 字数 312 浏览 7 评论 0原文

我目前正在构建一个针对移动设备优化的网站。

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

我有一个动态 JavaScript 网格,我不想在移动设备上缩放。

上面的行在 iphone 上完美运行,但我认为它不适用于 android 或 webos。如何为这些移动设备设置无比例模式。所以不存在捏和捏的情况。缩放并且设备宽度是 100% 浏览器宽度?

I am currently building a website optimized for mobile devices.

<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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏至、离别 2024-10-13 21:43:44

根据 http://developer.android.com/guide/webapps/targeting.html #Metadata,“用户可扩展”属性需要设置为“否”,而不是 0。因此:

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

编辑:页面底部附近的更多信息 Safari 参考库 - 支持的元标记

用户可扩展
确定用户是否可以
放大和缩小——无论是否
用户可以改变比例
视口。设置为 yes 以允许缩放
no 禁止缩放。这
默认为

还将用户可扩展设置为no
阻止网页滚动
在输入字段中输入文本。

适用于 iOS 1.0 及更高版本。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文