title: How can I get my slideshow to loop?
body: <p>I want to loop the slideshow that it gets back to the first image after the last image is displayed.
  I made a slideshow div that contains 5 different images, that will fade in and out after an x amount of time, but the looping part is not working for me.
  Thanks for any help! </p>
  
  <p>Html:</p>
  
  <pre><code>&lt;div id="slideshow2"&gt;
      &lt;img class="slider1" src="images/car1.jpg"&gt;&lt;/img&gt;
      &lt;img class="slider2" src="images/car2.jpg"&gt;&lt;/img&gt;
      &lt;img class="slider3" src="images/car3.jpg"&gt;&lt;/img&gt;
      &lt;img class="slider4" src="images/car4.jpg"&gt;&lt;/img&gt;
      &lt;img class="slider5" src="images/car5.jpg"&gt;&lt;/img&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>#slideshow2{
      width: 600px;
      height: 400px;
      background: black;
      position: relative;
      margin: 0 auto;
  }
  
  .slider1, .slider2, .slider3, .slider4, .slider5{
      opacity: 0;
      position: absolute;
  }
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code>    $(".slider1").animate({"opacity":"1"});
      $(".slider2").delay( 1500);
      $(".slider1").animate({"opacity":"0"});
      $(".slider2").animate({"opacity":"1"});
      $(".slider3").delay( 3000);
      $(".slider2").animate({"opacity":"0"});
      $(".slider3").animate({"opacity":"1"});
      $(".slider4").delay( 4500);
      $(".slider3").animate({"opacity":"0"});
      $(".slider4").animate({"opacity":"1"});
      $(".slider5").delay( 6000);
      $(".slider4").animate({"opacity":"0"});
      $(".slider5").animate({"opacity":"1"});
      $(".slider1").delay( 6000);
      $(".slider5").animate({"opacity":"0"});
  </code></pre>