skip to Main Content

How to detect browser viewport size change using JavaScript's matchMedia method?

How can I detect a change in viewport? The scripts: let vwChange = window.matchMedia("(min-width: 360px ) and (max-width: 765px )"); document.addEventListener("scroll", function(vwChange) { const headerChangek = document.querySelector(".footer_bottom_content"); if (window.scrollY < 3296) { headerChangek.classList.add("scrolledz"); } else { headerChangek.classList.remove("scrolledz"); } }) .footer_bottom_content…

VIEW QUESTION
Back To Top
Search