Answers for "javascript check less width of window"

0

javascript check less width of window

window.addEventListener("resize", function() {
  if (window.matchMedia("(min-width: 500px)").matches) {
    console.log("Screen width is at least 500px")
  } else {
    console.log("Screen less than 500px")
  }
})
Posted by: Guest on May-02-2021

Code answers related to "javascript check less width of window"

Code answers related to "Javascript"

Browse Popular Code Answers by Language