how to get orientation in js

Solutions on MaxInterview for how to get orientation in js by the best coders in the world

showing results for - "how to get orientation in js"
Echo
29 Jan 2019
1if (window.matchMedia("(orientation: portrait)").matches) {
2   // you're in PORTRAIT mode
3}
4
5if (window.matchMedia("(orientation: landscape)").matches) {
6   // you're in LANDSCAPE mode
7}
8