title: Loop through a set of names, taking action at interval
body: <p>In an HTML page using JavaScript/jQuery, I have an array of image file names (arListx). On that page, I have a routine called show(pict) that processes the image in certain ways, then displays it.</p>
  
  <p>I want to simulate a slideshow by running each image through show(pict) at a specific interval.</p>
  
  <p>The best luck I've had so far is getting the final image to show (evidently, all the images are run through the code but only the last shows).</p>
  
  <p>Using my interpretation of 5226285 (settimeout-in-a-for-loop-and-pass-i-as-value), I came up with this:</p>
  
  <pre><code>function doSetTimeout(i) {
    setTimeout(function() { show(arListx[i]); }, 5000);
  }
  .
  .
  .
  //[main]
  for(i=0; i&lt;arListx.length; i++) {
      doSetTimeout(i);
  }
  .
  .
  .
  function show(pict) {
      $("#OurPicture").attr('src',pict);
    .
    .
    .
  }
  </code></pre>
  
  <p>I'm obviously doing something wrong and would appreciate any suggestion.</p>