If element is X left then animate another element
<p>Im trying to anuimate an element on my site, but only when that element comes in to view. </p>

<p>To do this im checking to see when my wrapper div is X left, then fire the function. My only problem is nothing is happening, nor showing up on my console. </p>

<p>Ive tried adding an alert to my function to see if it fires only i dont see the alert. Can anybody see what im doing wrong? </p>

<pre><code>var width = 200;

setInterval(function(){
    if ($('.wrapper').css('left')&lt;width){
         $('.left-liftdoor').animate({
            left: -50
             }, 2000, function() {
         });
    }
}, 1000);
</code></pre>
