title: jquery for an if statement to act like CSS media query
body: <p>I have this jquery code which works great:</p>
  
  <pre><code>$(document).scroll(function(){
      if ($(this).scrollTop()&gt;175){
          // animate fixed div to small size:
          $('header').stop().animate({ height: 90 },100);
      } else {
          //  animate fixed div to original size
          $('header').stop().animate({ height: 175 },100);
      }
  });
  </code></pre>
  
  <p>I need the above to be present and read by all browsers/devices at all times but I also need to adjust the height of the smaller header (currently 90px - beneath the line // animate fixed div to small size:) for ONLY browser widths between 641px and 959px. I need the height of the header to be 120px for those browser widths only otherwise use the above code. </p>
  
  <p>A bit like Media queries where I'd like it update itself as the browser is resized.</p>
  
  <p>How do I do this exactly?</p>