title: Jumping animation in javascript?
body: <p>I'm trying to put together a simple game in javascript, and I cant get the jumping to work:</p>
  
  <pre><code>function jump()
   {
       isJumping=true;
  
      var jumpint= setInterval(function() {
      ypos=ypos-5;
      }, 10);
      if(ypos==150)
      {
          isJumping == false;
          clearInterval(jumpint);
          jumpint = 0;
          alert("it works");
          return;
  
      }
  
   }
  </code></pre>
  
  <p>Whenever I call this function it provides the animation, and the character moves in the right direction, but it doesn't stop. Once the ypos would equal 150 it keeps moving and doesn't execute the if statement and I cant figure out why. Obviously, I'll some equation in there, but I want to get this jumping to execute right before I move on. </p>