For example you need hide some block from javascript only on mobile device.


[php]
$(document).ready(function() {
function checkWidth() {
var windowSize = $(window).width();
if (windowSize < 480) {
console.log("screen width is less than 480");
}
else if (windowSize < 720) {
console.log("screen width is less than 720 but greater than or equal to 480");
}
else if (windowSize < 960) {
console.log("screen width is less than 960 but greater than or equal to 720");
}
else {
console.log("screen width is greater than or equal to 960");
}
}
// Execute on load
checkWidth();
// Bind event listener
$(window).resize(checkWidth);
});
[/php]





