Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript get device width

const mq = window.matchMedia( "(min-width: 500px)" );

if (mq.matches) {
  // window width is at least 500px
} else {
  // window width is less than 500px
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Javascript #device #width
ADD COMMENT
Topic
Name
6+4 =