4

This question has been asked many times on stackoverflow, but each time the correct answer was not working or not the correct one.

I am reopening this question, due to it's importance for mobile web device programmers.

I want to be able to stop rotation on a WEB SITE on a browser on one of the following OS: IOS and/or Android device or at least to modify the rotation to last landscape at least. So only landscape is permitted as a rotation.

I have tried many related questions with no solution:

Any idea is welcome, thank you.

p.s.

Community
  • 1
  • 1
radu florescu
  • 4,315
  • 10
  • 60
  • 92

1 Answers1

1

@CommonsWare is right, you shouldn't just block the user from being able to rotate their device however they want. In fact, that's what makes mobile web apps so versatile. They encompass the principals of responsive design.

I know this isn't the answer you're really looking for but if you insist on doing so, take a look here: Block mobile web rotation with javascript. I'm not sure but I'm guessing that still won't work simply because a web app isn't native to whatever device you're viewing it on and the app you're actually in is a browser eg Chrome, Safari, ect and those are almost certainly going to have different orientations enabled regardless of what your web app is doing.

Community
  • 1
  • 1
barndog
  • 6,975
  • 8
  • 53
  • 105
  • the link you provided, it the one I mentioned in the question that I have tried and didn't work for me. – radu florescu Mar 05 '13 at 18:56
  • Ah sorry didn't realize that. Well all I can say is that it's more likely not, not possible. – barndog Mar 05 '13 at 21:48
  • 2
    There are use cases where you would want a webpage to stay in a certain orientation. For instance, if a html5 web game was designed to use orientation to change direction. You want the graphics/page itself to stay in the same direction with no rotation animation as it would them be a jarring jump in the game you may not want. – WORMSS Jan 10 '14 at 15:48