title: setTimeout not working, other methods of queuing in a for loop?
body: <p>Code below (the divs are shaded in my real example, I want to sequentially decrease their opacity to 0 so each disappears, in order.</p>
  
  <p>I tried to doing this without using setTimeout, but all of the divs disappeared simultaneously - its good to know that the part of the code that changes the opacity works, but I cant seem to get them to work sequentially. </p>
  
  <p>When I try to use setTimeout (which I presume I am implementing incorrectly),nothing happens!</p>
  
  <p>Any help would be really appreciated with this, I'm fairly new to JavaScript and haven't touched it in a while and tutorials haven't been able to help me. </p>
  
  <pre><code>&lt;body&gt;
      &lt;div id="div1"&gt;&lt;/div&gt;
      &lt;div id="div2"&gt;&lt;/div&gt;
      &lt;div id="div3"&gt;&lt;/div&gt;
      &lt;div id="div4"&gt;&lt;/div&gt;
  
          &lt;script type="text/javascript"&gt;
      // the divs that we want to cycle through are named here.
      var divs = ["#div1", "#div2", "#div3", "#div4"];
      var divsLength = divs.length;   
  
          for (var i = 0; i &lt; divsLength; i++) {
              setTimeout(function(){ 
                $(divs[i]).fadeTo(1000, 0, function() {   
                });
              },1500);
          };  
  
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>