title: fadein fadeout javascript slideshow
body: <p>Im trying to create a simple fade in fade out image slideshow in javascript. Ive managed to create one that shows one image, fades out and then fades another image in but this is not what im going for. What i want is so that when the first image fades out, there is already another image behind it and when the other image also fades out, theres another image behind that one too. Im trying to avoid having the part of the webpage that holds the slideshow from being empty at any time during the slideshow. Can anyone help me out by editing my code or showing me how I can achieve this?</p>
  
  <pre><code>var count = 1;
  setInterval(function(){
  if (count &lt;= 3){
      $("#slideshow").fadeOut(2000);
      setTimeout(function(){$("#slideshow").attr("src","breakup/"+ count +".jpg")},2000);
      $("#slideshow").fadeIn(2000);
      count++;
  
      if (count&gt;3){
      count = 1
      }
  }//end if
  }/*end function*/,5000);
  </code></pre>