Hello all,

I found the following script that is close to what I was looking for. However I was hoping that someone could help me figure out how to have the image simply fade into the next image instead of fading to white then displaying the next image. Any help would be greatly appreciated!

JavaScript in Head:
Code:
<script type="text/javascript">

function changeImage()
{
    var img = document.getElementById("img");
    img.src = images[x];
    x++;

    if(x >= images.length){
        x = 0;
    } 

    fadeImg(img, 100, true);
    setTimeout("changeImage()", 3000);
}

function fadeImg(el, val, fade){
    if(fade === true){
        val--;
    }else{
        val ++;
    }

    if(val > 0 && val < 100){
        el.style.opacity = val / 100;
        setTimeout(function(){fadeImg(el, val, fade);}, 10);
    }
}

var images = [],
x = 0;

images[0] = "image1.jpg";
images[1] = "image2.jpg";
images[2] = "image3.jpg";
setTimeout("changeImage()", 3000);

</script>
Body:
HTML Code:
<img id="img" src="startpicture.jpg">