Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #orientation #js
ADD COMMENT
Topic
Name
2+5 =