title: Fixing if statement to stop movement
body: <p><strong>What I am trying to achieve</strong></p>
  
  <p>The racer-offset is so that the user can set how far a image can move in px. The offsetted manages how far it has offsetted. Speed-racer tells how fast the Image can move during scrolling. My problem is it doesnt stop. I can provide a fiddle, but lets try first to see if this is easy to fix without it. Thanks.</p>
  
  <p>HTML</p>
  
  <pre><code> &lt;img class="images" racer-offset="250" speed-racer="3" src="http://assets/img/fwman/FeeneyMan_bike.png" loc="576" style="left: 540px;" offsetted="924"&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>    $(window).scroll(function(){
      $('.images').each(function(){
          if($('this').attr('racer-offset') &lt; $(this).attr('offsetted')){
  
          }
          else {
      var speedR = $(this).attr('speed-racer');
      $('.images').css({left : "-="+speedR});
      $('.images').attr('offsetted', $(this).position().left);
      }
      });
  });
  
     $('.images').each(function(){
          $(this).attr('loc', $(this).position().left);
     });
  </code></pre>
  
  <hr>
  
  <p>NEW VERSION</p>
  
  <pre><code>$(window).scroll(function(){
      if(lastLeftLocation &gt; $(document).scrollLeft()) {
          $('.images').each(function(){
                  if($(this).position().left &gt;= $(this).attr('loc')){
                  console.log("0 == stopped");
  
                  }
                  else {
                  speedR = $(this).attr('speed-racer');
                  $(this).css({left : "+="+speedR});
                  $(this).attr('racer-offset') + speedR;
                  $(this).attr('racer-offset', $(this).attr('speed-racer') + $(this).attr('racer-offset'));
                  }
              });
          }
      else {
          $('.images').each(function(){
              if($(this).attr('racer-offset') &lt;= 0){
              console.log("0 == stopped");
              }
              else {
              speedR = $(this).attr('speed-racer');
              $(this).css({left : "-="+speedR});
              $(this).attr('racer-offset', $(this).attr('racer-offset') - speedR);
              }
          });
      }
  
  
  });
  </code></pre>
  
  <p>The only thing left to fix is I need speed-racer to add to racer offset in the if portion. </p>
  
  <pre><code>       $(this).attr('racer-offset', $(this).attr('speed-racer') + $(this).attr('racer-offset'));
  </code></pre>