Reset Scale/width/zoom Of Safari On Iphone Using Javascript/onorientationchange
Solution 1:
The "answer" accepted above is not really an answer, in that disallowing any zooming whatsoever is as bad as asking an IE user to switch to another browser. It's terrible for accessibility. You want to your design to not do funky zoom things that Apple has deemed ideal upon switching view orientation, but you are leaving disabled users in the dust. Highly not recommended.
Try using media queries or a js hook (screen.width, etc) to adjust your design automatically upon orientation change. It's why these attributes are exposed to us as developers.
Solution 2:
Here is what I use to deal with the zoom on my media-queries:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;">
The maximum-scale is the thing that sold it for me. It means the transition from portrait to landscape on an iphone is really smooth with no zoom problems at all...
Solution 3:
I had some problems with the zoom levels changing from landscape to portrait, when the content was larger than the viewport. Setting "minimum-scale=1.0", solved this for me.
Solution 4:
This wont work if you are running a web-app in safari, but I think it will work if you are using a UIWebView inside your own app.
I havent tested this, but there is an easy way to get your javascript to talk to the objective-c side of the code at which point you would have access to things like the zoom of the web view.
Solution 5:
I had this issue too I think. Try putting a "maximum-scale=1.0" (and maybe a "minumum-scale=1.0" if you feel like it) in your viewport tag. This assumes you don't want the user to be able scale though (which I don't)
Post a Comment for "Reset Scale/width/zoom Of Safari On Iphone Using Javascript/onorientationchange"