Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jquery window width condition Re: jquery window width condition

#105175
dynamyc
Member

I’ve tried this and it’s not working proper:

$(document).ready(function() {
if ( $(window).width() > 800 ) {
$("#header").hide();
}
else {
$("#header").show();
}

});

f I resize the window below 800 the header is still invisible. What is the problem ? I can’t use css media queries because I want to execute other functions when the windows is bigger than 800.