var windowWidth = $(window).width();
function mobileResponsiveCheck(){
if(windowWidth >= 768){
box3Responsiveness();
}else if(windowWidth < 768){
null;
}
}
$(window).resize(function(){
mobileResponsiveCheck();
});
mobileResponsiveCheck();
So I want to run the function mobileResponsiveCheck() every time the user resizes and also if reloaded. While resizing if window gets smaller than 768px then it is supposed to do nothing. But this only happens when I reload it after it is smaller than 768px. What I want is it box3Responsiveness() stopped as the user is resizing and get below 768px without reload.
else if(windowWidth < 768)to justelsenullis redundant codebox3Responsiveness()from running. We can't tell from your code sample.