PDA

View Full Version : Cyclung Banner Fade In Effect?


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>

boywonder
09-28-2002, 12:20 AM
Check out these links, does that help you?

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/howto/applyingtransition.asp

http://msdn.microsoft.com/workshop/samples/author/behaviors/htmltime/transitions/fillex1.html

asatyss
09-28-2002, 02:00 AM
That second link is alot like what I want to do, but I was wondering if there was a way to do it by just adding a style to the code I have already written.

Thanks for the links.:thumbsup:

asatyss
09-29-2002, 02:42 AM
I found a piece of code that I tried, but I didn't like the way it faded. Basically, it darkened the picture a little then lightened it with the new one. If there is anything that would make the picture appear through the other picture that is what I am looking for.

Thanks for helping!

asatyss
09-30-2002, 01:56 PM
I tried another piece of code, but again, I didn't like the effect. I'm kinda picky. Anyway, if anyone else has an idea, I would love to try it.