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


source to share





All Articles