In JQuery, for mobile devices I need to fix the devices orientation to portrait so that nothing changes when the user rotates the device. I have seen suggestions on how to do this for Android (in the manifest). Is there a similar solution for iOS? Of course, a JQuery solution would be best. Can anyone help? Thanks in advance.
Asked
Active
Viewed 695 times
0
-
I was indeed aware of these answers, but as they are a few years old, I was hoping that in our fast-changing world this too had changed. I guess not :-( – AlexFStop Feb 12 '14 at 03:45
1 Answers
0
you can't force orientation but you can show a message that the website only works on portrait orientation.
check te jQuery Orientation Change Event
if you were developing an app you'd be able to achieve that behavior but when it comes to web pages it's up to the browser and since browsers work on both orientations... i think the only way you would ever be able to achieve this would be to have diferent stylesheets for each orientation and when on landscape orientation your css would rotate and position every element making it look like it's still in portrait. this would probably give you a lot of work and then there's also compatibility issues for different browsers, but if you really want to, it's worth a try.

FabioG
- 2,936
- 3
- 31
- 50
-
Thanks, Fabio. Not the answer I was hoping for but at least now I know for sure that it can't be done. I have an iPhone app which displays photos in landscape and does not rotate them when I rotate the phone, and I was hoping to duplicate this behavior. I guess that app has some secret sauce. – AlexFStop Feb 12 '14 at 03:48
-