I'm new with jquery. I tried to detect browser size using the following code and tried various ways but it alerts yay
whenever the browser is resized. I checked online and I couldn't figure out what went wrong with my code. Would anyone know why? I'm trying to detect the size so I could disable the area tag link on the image on mobile screen.
$(window).ready(function() {
$(window).resize(function() {
var wi=$(window).width();
var he=$(window).height();
if ((wi<=480) && (he<=568))
{
alert('yay');
}
});
});