title: JQuery if statement with negative & positive values
body: <p>I got two variables in a function: $x= -660px and is fixed and $y which is reduced by 20px each time the function is called. $y = 220px the first time the function is called. <br>
  In the function I got an if else statement</p>
  
  <pre><code>    if($y &gt; $x){
      //do something
      }else{
      //do nothing
      }
  </code></pre>
  
  <p>What I'm trying to get is for $y to be reduced as long as its bigger than -660px and then stop.</p>
  
  <p>it works fine until $y = -20px. ie. the if statement 'does something' until $y = -20px and then it stops but doesn't execute the 'else' statement.</p>
  
  <p>I can't find out what's wrong with it. Is this correct or might my problem  come from somewhere else?</p>
  
  <hr>