title: Jquery scrolltop triggering a function between two points?
body: <p>I'm trying to apply a class to a div only when the window top is between 500 and 900 pixels but not before or after. Is this possible? </p>
  
  <p>My current code only works for past 500px:</p>
  
  <pre><code>if($(this).scrollTop() &gt;= 500) {
    $('#01').addClass('selected');    
  } else {
    $('#01').removeClass('selected');
  }
  </code></pre>
  
  <p>Is it possible to have something this?:</p>
  
  <pre><code>if($(this).scrollTop() &gt;= 500 &lt;= 900) {
    $('#01').addClass('selected');    
  } else {
    $('#01').removeClass('selected');
  }
  </code></pre>
  
  <p>Thanks!</p>