To provide fadeIn and FadeOut for images in div tag
<p>I had used a SetInterval jquery function to add a slideshow of few images.The image sourse are stored inside an array and also the time interval of displaying of each image is also stored in an array.The code is working, But I want to add a fadeIn and FadeOut for each image with duration and opacity,How can it be done. The code used is</p>

<pre><code>  //timearray- is array storing time for each image
  //imagearray- is array storing each image source
  //image_div-is div tag in which images are displayed
  // total 5 images -so used count inside setInterval

function imageshow() {
    var imgfade = setInterval(function () {
        $("#img_div").css("background", "url('" + imagearray[count] + "')");
        clearInterval(imgfade);
        if (count &lt; 4) {
            count++;
        } else {
            count = 0;
        };
        imageshow()
    }, timearray[count]);
}

imageshow();
</code></pre>

<p>I need to use fadeIn and FadeOut for each image.</p>
