I am creating a jQuery function which, on window resize, performs the following task:
If window width increases, call profdisplayer
function. If window width decreases call profhider
function.
I don't know what is wrong with this and how to resolve this.
$(window).on('resize', function(event){
var awidth = $(window).width();
var bwidth=0;
if (awidth>bwidth)
{ profdisplayer();
bwidth = awidth;
}
if (bwidth>awidth)
{
profhider();
bwidth=awidth;
}
});