Home › Forums › JavaScript › jquery window width condition › Re: jquery window width condition
July 1, 2012 at 9:59 am
#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.