I'm trying to check if users reduced or increased there screens.
I have the following function and it works fine, but it relies only on the initial screen size:
var width = $(window).width();
$(function(){
$(window).resize(function(){
var resizeWidth = $(this).width();
if (resizeWidth > width) {
console.log('increased!')
width = width + 1;
} else {
console.log('reduced!')
width = width - 1;
}
});
});
Is it possible to know if the screen is increased or reduced at any time and not on the initial screen size?
Thank you all!