title: Background slideshow (javascript) fade transition effect
body: <p>I am trying to apply the fade effect to the javascsript background slideshow. When I changed the value, JS ignored it. I tried fadeIn and fadeOut. What is wrong with this code?</p>
  
  <pre><code>var bgimages=new Array()
  bgimages[0]="tenis.jpg"
  bgimages[1]="rtrr.jpg"
  bgimages[2]="tenis.jpg"
  
  //preload images
  var pathToImg=new Array()
  for (i=0;i&lt;bgimages.length;i++) {
      pathToImg[i]=new Image()
      pathToImg[i].src=bgimages[i]
  }
  var inc=-1
  
  function bgSlide() {
      if (inc&lt;bgimages.length-1)
          inc++
      else
          inc=0
  
      document.body.background=pathToImg[inc].src
  }
  
  if (document.all||document.getElementById)
      window.onload=new Function('bgSlide(); setInterval("bgSlide()",3000),fade(2000)')
  </code></pre>