I'm experiencing this problem on an iPhone device (iPhone 7, iOS 10, but also other iPhones too): in javascript, if I intercept the orientationchange event, inside the handler, screen.width and screen.height remain the same (as before rotation).
Since this may depend from the viewport settings, this is how my viewport is declared in the .html file:
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=no" />
Everything works fine in Chrome's simulated visualization.
Thanks in advance for your help.
As far as I know screen the width/height will not change in the device after rotation. To check if the device is rotated you could read these properties
Unfortunately, this behavior is not consistent across all Android/iOS/Window devices. I think it's pretty explained in this figure .
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