JavaScript重置移动视口缩放级别
我有一个网站,移动用户经常放大非常意图的照片。但是,当访问某些链接或特定的JavaScript事件发生时,我需要重置缩放。专门针对移动野生动物园。
请注意:
- 读取
meta [name =“ viewport”]
的各种解决方案,然后设置其内容被移动Safari忽略。也许几年前起作用,但现在没有。
到目前为止,我拥有的最好的想法是为链接工作,将它们全部指向另一个域(确实重置视口),然后将该域立即重定向到我的站点。我将实际的预期URL作为获取参数。我测试了它,它起作用了,但是却是。它也只有对链接的帮助,我希望能够为没有导航的JavaScript事件做到这一点。
I have a site where mobile users often zoom in on photos which is very much intended. However, I have a need to reset the zoom when certain links are accessed or specific javascript events fire. Specifically targeting mobile Safari.
Please note:
- Various solutions to read
meta[name="viewport"]
and then set its content are ignored by mobile Safari. Maybe that worked years ago, but it doesn't now.
The best idea I've have so far that works for links is to point them all to a different domain (which does reset the viewport) and then have that domain instantly redirect back to my site. I'd pass the actual intended URL as a GET param. I tested it and it works, but sheesh. It also only helps for links, I want to be able to do it for javascript events where there is no navigation taking place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论