使用 javascript 更改 iPhone 视口时的错误

发布于 2024-08-22 00:40:31 字数 552 浏览 5 评论 0原文

我正在构建一个 Web iPhone 应用程序,其中涉及更改视口 需求与Javascript。我通过更改内容属性来做到这一点 标签。这在大多数时候都有效, 除非涉及方向改变。

每次我尝试在方向改变后改变视口 事件,页面不再缩放到完整尺寸,并且 出现方格背景。

以下是重现此问题的方法:

  1. 转至 http://daedalus.rcboyce.com/viewport/
  2. 调整大小至 980(iPhone 的默认设置)
  3. 调整大小至 320(有效)
  4. 调整回 980
  5. 进入横向模式
  6. 再次返回纵向模式
  7. 调整大小至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:

  1. Go to http:// daedalus.rcboyce.com/viewport/
  2. Resize to 980 (iPhone's default)
  3. Resize to 320 (works)
  4. Resize back to 980
  5. Go to landscape mode
  6. Go to portrait mode back again
  7. 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 技术交流群。

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

发布评论

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

评论(1

煞人兵器 2024-08-29 00:40:31

抱歉,但我没有看到添加评论的按钮或链接...

我刚刚向苹果提交了错误报告,因为即使在用户捏合后,视口更改也会停止响应,而不仅仅是方向更改。我个人认识一位 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

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