I'm using the .resize()
function to detect window re-size events, but this detects both height and width changes.
Is there any way to detect just a width change and not a height change?
var width = $(window).width();
$(window).on('resize', function() {
if ($(this).width() !== width) {
width = $(this).width();
console.log(width);
}
});