仅在某些页面上进行捏合缩放

发布于 2024-12-14 04:49:59 字数 107 浏览 2 评论 0原文

是否有可能使移动网站在某些页面上具有捏合缩放功能,但在其他页面上不具有捏缩放功能,例如不在主页上,但在带有图像的页面上?我希望人们能够放大图像,但我不希望他们放大其他页面,因为文本变得非常小或非常大。

Is it possible to make a mobile website have pinch to zoom capabilities on some pages but not other, for example not on the home page, but on a page with a image on it? I want people to be able to zoom into images but I don't want them to zoom on other pages because the text gets really little or really big.

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

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

发布评论

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

评论(1

☆獨立☆ 2024-12-21 04:49:59

一般来说,让用户决定文本是否太大或太小是一个很好的做法。

但是,如果您确实想控制它,请使用视口元标记:

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

保持初始比例和最大比例相同,或者将用户可缩放设置为否,可以让您阻止用户缩放。将 user-scalable 设置为 yes 并调整初始比例和最大比例以设置页面开始缩放的方式以及用户可以放大到多远。

请参阅:

http://www.html5rocks.com/en/mobile /mobifying.html#toc-meta-viewport

Generally, it's good practice to let users decide if text is too large or small.

But, if you do want to control it, use the viewport meta-tag:

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

Keeping initial-scale and maximum-scale the same, or by setting user-scalable to no, will let you keep the user from zooming. Set user-scalable to yes and adjust the initial-scale and the maximum scale to set how zoomed in the page starts, and how far the user can zoom in to.

See:

http://www.html5rocks.com/en/mobile/mobifying.html#toc-meta-viewport

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