How to determine the rotation state of the screen?

I am writing an implementation of an orientationchangeend

event.

To determine the end orientationchange

, I track the state window.innerWidth

and window.innerHeight

after the event orientationchange

was fired. If these values ​​don't change for the X

number of iterations (using setInterval

), I run orientationchangeend

.

Is there another variable I could track instead of window.innerWidth

/ window.innerHeight

that is more specific? Does it rotate anywhere in the API? (for example, a CSS transform that rotates the screen, assuming there is one).

+3
javascript mobile-safari screen-orientation orientation-changes


source to share


No one has answered this question yet

Check out similar questions:

7728
How do I redirect to another web page?
7649
How does JavaScript blocking work?
7494
How can I remove a specific element from an array in JavaScript?
7432
How to check if a string contains a substring in JavaScript?
7428
How can I check if an element is hidden in jQuery?
5722
How can I remove a property from a JavaScript object?
5129
How do I return a response from an asynchronous call?
4829
How do I include a JavaScript file in another JavaScript file?
2709
Detecting object property undefined
2329
How do I detect a click outside of an element?



All Articles
Loading...
X
Show
Funny
Dev
Pics