title: if/else statement for scrolltop jquery
body: <p>I'm having some problems in writing my own jQuery script</p>
  
  <p>Here's the problem, I wanted to create a button that slide the window down
  and I used if/else statement to determent the situation.</p>
  
  <p>here's the code:</p>
  
  <pre><code>var main = function() {
  
      $('.down').click(function() {
  
      var x= $(window).scrollTop();
      alert(x);
      var s;
  
      if (x &lt; 500){
        s = 500;
      }else if(500 &lt;=x&lt;700 ){
        s = 700;
      }else{
        s=1000;
      };
  
      $('html, body').animate(
        {scrollTop: s}, 1000);
  
      });
  };
  
  $(document).ready(main);
  </code></pre>
  
  <p>However, when the window slide to 700, it no longer execute the next else statement which scroll to 1000.
  any ideas? :(</p>