Reputation: 2803
I just don't want the site change orientation when iPhone change orientation.
Is it possible?
Upvotes: 3
Views: 2333
Reputation: 67802
See this answer for how to use CSS/JS to rotate the rendered display on orientation change. The idea is to capture the orientation event, and then force the display back to portrait/landscape.
How do I lock the orientation to portrait mode in a iPhone Web Application?
Upvotes: 2
Reputation: 630339
You can't prevent this via JavaScript, it's browser controlled...and really you'd be breaking the user's expectations of behavior if you could do this, which is hardly ever a good thing.
Also if you could, which orientation would the user be in? When they arrived on your site the phone could have been in either orientation.
Upvotes: 6