title: add a pause in running each line of a loop
body: <p><s></p>
  
  <pre><code>function change ()
  {
      for( var i=0 ; i&lt;5 ; i++) ;
      {     
          alert(5) ;
      }
  }
  </code></pre>
  
  <p>alert 5.after i click OK,waiting for 5s,alert 5 again,waiting for 5.and do this for 5 times.
  but it doesn't work correctly with the setTimeout function</s></p>
  
  <p>UPDATE: Here is what I'm really trying to do:</p>
  
  <pre><code>var groopBox = $("#"+value.value+" .group") ;
  for ( var i=0 ; i&lt;groopBox.length ; i++ ) {
       groopBox.eq(i).slideToggle(1000)
  }
  </code></pre>
  
  <p>This works but when i put this code block in <code>setTimeout</code> it doesn't work:</p>
  
  <pre><code>var groopBox = $("#"+value.value+" .group") ;
  for ( var i=0 ; i&lt;groopBox.length ; i++ ) {
       setTimeout(function(){ groopBox.eq(i).slideToggle(1000) }, i*2000)
  }
  </code></pre>