Javascript: nested loops?
<p>I'd like to achieve an animation/sequence like this:</p>

<p>the animation starts with a loop (imagine a <strong>car</strong> moving from x1 to x2) then a pause of 1 second then again the animation (imagine a <strong>car</strong> moving from x2 to x3 etc) </p>

<p>the <strong>car</strong> loop is achieved adding 1px to the car left: value</p>

<p>but i cant figure out the nested loop how should work</p>

<p>i'm trying to do ti only using setInterval, no jquery</p>

<p><strong>UPDATE: sorry i wasnt clear</strong></p>

<p>but assume we have </p>

<pre><code>var animation = setInterval(car_moves, 10);
</code></pre>

<p>how do i trigger this animation every 2 seconds, and the animation should last 0.5sec ?</p>
