2012-08-17 91 views
0

我有一个网页,不会(也不应该)允许在iPad上缩放。iPad Zoom在Safarai的未聚焦选项卡上的问题

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中打开一切都很正常,但在这种情况下。由于我通过视口meta标记禁用了缩放,所以缩放不应该改变。让事情变得更加陌生:如果我刷新页面或者甚至导航到某个其他网站,缩放将不会刷新。

我也注意到在其他网站上发生这种情况。我尝试了所有可以想象的元标记组合(禁用缩放)。我正在用iPad 3进行测试。如果我只在Safari中打开一个选项卡,则不存在任何问题。

这似乎涉及到“著名”的定位问题不作为不良变焦时出现的应用程序没有焦点 How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

回答

0

这是我如何解决了这个问题:

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