使用 javascript 更改 iPhone 视口时的错误
我正在构建一个 Web iPhone 应用程序,其中涉及更改视口 需求与Javascript。我通过更改内容属性来做到这一点 标签。这在大多数时候都有效, 除非涉及方向改变。
每次我尝试在方向改变后改变视口 事件,页面不再缩放到完整尺寸,并且 出现方格背景。
以下是重现此问题的方法:
- 转至 http://daedalus.rcboyce.com/viewport/
- 调整大小至 980(iPhone 的默认设置)
- 调整大小至 320(有效)
- 调整回 980
- 进入横向模式
- 再次返回纵向模式
- 调整大小至320(每次尝试都失败)
以下是其外观的屏幕截图:http://tinypic.com/ r/15qyzoh/6
有人知道为什么会发生这种情况吗?这是一个 MobileSafari 的 bug,如果是的话,有办法修复吗?
I'm building a web iPhone app that involves changing the viewport on
demand with Javascript. I do this by changing the content attribute of
the tag. This works well most of the times,
except when orientation change is involved.
Everytime I try to change the viewport after an orientation change
event, the page doesn't zoom to it's full size anymore, and a
checkered background appears.
Here's a way to reproduce this:
- Go to http:// daedalus.rcboyce.com/viewport/
- Resize to 980 (iPhone's default)
- Resize to 320 (works)
- Resize back to 980
- Go to landscape mode
- Go to portrait mode back again
- Resize to 320 (fails every time I tried)
Here's a screenshot of how it looks: http://tinypic.com/r/15qyzoh/6
Does anybody have any ideea why this is happening? Is this a
MobileSafari bug, and if so, is there anyway to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,但我没有看到添加评论的按钮或链接...
我刚刚向苹果提交了错误报告,因为即使在用户捏合后,视口更改也会停止响应,而不仅仅是方向更改。我个人认识一位 Safari 工程师,他认识一些移动 Safari 人员,他会向他们询问此事,或者至少引起他们的注意
I'm sorry, but I don't see a button or link to add a comment...
I just submitted a bug report to apple because the viewport changes stop responding even after a user pinches, not just orientation change. I personally know a safari engineer and he knows some of the mobile safari people and he is going to ask them about it, or at least bring it to their attention