asatyss
09-27-2002, 11:13 PM
I am making a cycling banner and was wondering if there was a command that would make the new image fade in instead of just switching to the next image.
Here are a few snippets of code so you can see what I am doing...
<SCRIPT LANGUAGE="JavaScript">
imgArray = new Array(3);
imgArray[0] = new Image;
imgArray[0].src = "images/Motto.jpg";
imgArray[1] = new Image;
imgArray[1].src = "images/Motto2.jpg";
imgArray[2] = new Image;
imgArray[2].src = "images/Motto3.jpg";
index = 0;
function cycle() {
//change the motto banner atthe bottom of the page
document.banner.src = imgArray[index].src;
index++
if (index == 3)
{
index = 0;
}
setTimeout("cycle()", 2000);
return;
}
</SCRIPT>
<body onLoad="cycle();">
<img src="images/Motto.jpg" name="banner">
</body>
Here are a few snippets of code so you can see what I am doing...
<SCRIPT LANGUAGE="JavaScript">
imgArray = new Array(3);
imgArray[0] = new Image;
imgArray[0].src = "images/Motto.jpg";
imgArray[1] = new Image;
imgArray[1].src = "images/Motto2.jpg";
imgArray[2] = new Image;
imgArray[2].src = "images/Motto3.jpg";
index = 0;
function cycle() {
//change the motto banner atthe bottom of the page
document.banner.src = imgArray[index].src;
index++
if (index == 3)
{
index = 0;
}
setTimeout("cycle()", 2000);
return;
}
</SCRIPT>
<body onLoad="cycle();">
<img src="images/Motto.jpg" name="banner">
</body>