jQuery.animate() in a for loop
<p>I have the following code:</p>

<pre><code>$("." + selectedOption + ":eq(0)").show().animate({
    left: 0 + $(".option1:visible").outerWidth(),
    opacity: 1
}, 700, function() {
    $("." + selectedOption + ":eq(0)").animate({
        top: 0
    }, 700);
});
</code></pre>

<p>This works just as I want it to... but I want to repeat this animation numerous times over, each time animating the next "selectedOption", i.e. :eq(1), :eq(2), :eq(3).  So I thought putting the above code within a for loop would work:</p>

<pre><code>for(i = 0; i &lt; 5; i++) {
    //code here
}
</code></pre>

<p>When I did it doesn't work.  Any ideas why?</p>

<p>Thanks</p>