title: Image Slider in Javascript
body: <p>This image slider won't show the next pic. I have 3 images .. image1, image2 and image3 but it only stays on image1..</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var image1 = new Image();
  image1.src="jokes.png";
  var image2 = new Image();
  image2.src="facts.png";
  var image3 = new Image();
  image3.src="csharp.png";
  &lt;/script&gt;
  
  
  
  &lt;img src="jokes.png" name="slide" width="200" height="200"&gt;
  &lt;script type="text/javascript"&gt;
  var step = 1;
  
  function slideit() {
      document.images.slide.src = eval("image" + step + ".src");
      if (step &lt; 3) {
          step++;
          else step = 1
          setTimeout("slideit()", 2500);
      }
      slideit()
  }
  &lt;/script&gt;
  </code></pre>