I've seen similar questions on this issue, but they are related to native apps. I build web apps for the iPhone/iPad that run in the browser (Safari).
I was wondering if there is a way to prevent orientation change in the browser, perhaps via some meta tag. I know of the viewport meta tag which allows you to specify scale and zooming capabilities, so figured maybe there is something similar for orientation.
I doubt it is possible, but I thought I'd just pop a question on here to see.
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.
Whether you are holding your device upwards or sideways, swipe down from the top of the screen. Tap the Auto rotate icon to lock your device in your desired position.
If the rotation lock icon does not appear on your screen and your iPad's native apps won't rotate, your iPad is most likely experiencing a software glitch. Turning the iPad off completely, then restarting it should fix the issue. If not, your software may be outdated.
Portrait Orientation icon. to lock or unlock screen portrait orientation. When the icon is highlighted in white, the screen is locked into portrait orientation mode. The Contol Center screen may vary slightly depending on the device model.
You can detect orientation changes with onorientationchange
.
Javascript:
/*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode*/
window.onorientationchange = function() {
var orientation = window.orientation;
switch(orientation) {
case 0:
//Portrait mode
case 90:
// Landscape left
case -90:
//Landscape right
}
It's written in iPhone doc. Here from iPhone docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With