Answers for "how to get orientation in js"

0

how to get orientation in js

if (window.matchMedia("(orientation: portrait)").matches) {
   // you're in PORTRAIT mode
}

if (window.matchMedia("(orientation: landscape)").matches) {
   // you're in LANDSCAPE mode
}
Posted by: Guest on October-22-2020

Code answers related to "how to get orientation in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language