Is there any way to prevent the change of a websites orientation regardless of how a mobile device is rotated without having to write platform specific code? Under the circumstances the goal is to keep a site in "Portrait" mode.
Asked
Active
Viewed 399 times
0
-
1Nope. Best you an do is plan your site for a "responsive layout" without something like [Foundation](http://foundation.zurb.com/). A native client would give you more control, but in the JS world you can only detect when the size changes. β SciSpear Aug 08 '12 at 04:29
-
@SciSpear 'nuf said. You should post that as an answer. Preventing a handheld device from rotating the website simply goes beyond the limits of JavaScript. β Kiruse Aug 08 '12 at 04:33
-
@Derija93βit is possible with script (it's actually quite easy), but disabling orientation changes should only be done if there's an extremely good (usually very specific) reason. β RobG Aug 08 '12 at 04:43
1 Answers
1
Nope. Best you an do is plan your site for a "responsive layout" without something like Foundation or Twitter Bootstrap. A native client would give you more control, but in the JS world you can only detect when the size changes.
Under the advice of @Derija93 I posted this as an answer so we can close this question.
EDIT: Now that being said. You might be able to fake it with some css translations (you will see it jump around).. but I really would not recommend going down this path.