Safarai中未聚焦标签上的iPad缩放问题

Safarai中未聚焦标签上的iPad缩放问题,ipad,orientation,mobile-safari,zooming,Ipad,Orientation,Mobile Safari,Zooming,我有一个网页不允许(也不应该)在iPad上进行缩放。除了在Safari中打开多个选项卡的情况外,一切都很好: 1. have focus on my application's tab 2. change to a different tab 3. switch the iPad's orientation (i.e. portrait to landscape or vice versa) 4. switch back to my web apps tab 在

我有一个网页不允许(也不应该)在iPad上进行缩放。除了在Safari中打开多个选项卡的情况外,一切都很好:

    1. have focus on my application's tab
    2. change to a different tab
    3. switch the iPad's orientation (i.e. portrait to landscape or vice versa)
    4. switch back to my web apps tab
在很多情况下,iPad会放大,我无法重置缩放。由于我已通过视口元标记禁用缩放,因此缩放不应更改。让事情变得更奇怪:如果我刷新页面,甚至导航到其他网站,缩放将不会刷新

我在其他网站上也注意到了这种情况。我尝试了所有可能的元标记组合(禁用缩放)。我正在用iPad3进行测试。如果我在Safari中只打开了一个选项卡,那么我就没有问题了

这似乎与“著名的”方向问题无关,因为当应用程序没有焦点时,会出现不需要的缩放

以下是我如何解决这个问题的:

1. use the onorientationchange event to detect if the zoom is changed
2. if the zoom has changed change the viewport meta tag to: user-scalable=yes
3. on $(window).resize or onorientationchange change viewport back to user-scalable=no if the user has changed the zoom back to fit the screen