How to check device orientation in JavaScript?
Detecting Orientation Changes in Javascript
Should you need to simply detect when a user changes orientation, you can use the following event listener: screen. orientation. addEventListener("change", function(e) // Do something on change );
What are the types of screen orientation?
Any is an orientation that means the screen can be locked to any one of portrait-primary, portrait-secondary, landscape-primary and landscape-secondary. The default screen orientation is the set of orientations to which the screen is locked when there is no current orientation lock.