title: Pass for loop count value to JQuery SlideUp Callback
body: <p>Using the code below as an example, I want to pass the value 'i' to the callback function, so that it will remove the class from the correct div. At present, this just sees i as it's last value in the loop.</p>
  
  <pre><code>for(i=0;i&lt;tablelength;i++){
      if($('#detailsdiv'+i).is(':visible')){
          $('#anotherdiv'+i).slideUp('slow',function(){
          $('#div'+i).removeClass('open');
      });
  }
  </code></pre>