JavaScript
Result
Run
License
window.addEventListener("resize", function() { var mquery = "(min-width: 400px)"; var mql = window.matchMedia(mquery); if (mql.matches) { document.body.textContent = "고해상도"; document.body.style.background = "#CCC"; } else { document.body.textContent = "저해상도"; document.body.style.background = "#FFFF00"; } }); window.addEventListener("load", function() { var resizeEvent = new Event("resize"); window.dispatchEvent(resizeEvent); });
Console
expand_less
License
License
by DevDic
Close