javascript if window size is less than code example
Example 1: jquery check if screen size
if ($(window).width() < 960) {
alert('Less than 960');
}
else {
alert('More than 960');
}
Example 2: 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")
}
})