how to know the width of the media screen in javascript code example
Example 1: if media query jquery
$(window).resize(function() {
if ($(this).width() < 1024) {
// your code
} else {
// your code
}
});
Example 2: device width js
window.screen.availWidth