16
Jul

Ok so this might potentially be a tough question, keep that in mind. All the effects I explain will be accomplished using jQuery, I only need advice regarding the actual logic.

Ok so basically I have a collection of photos (which I will be storing in an array), let's say 5.

Every 12 seconds, I want to fade out the current image, and fade the next one in the array in. If it gets to the very last picture, I want it to go back to the first picture. This needs to be done endlessly. Someone recommended I used setInterval() for this, but I’ve no idea how to go about this. Any recommendations at all?


Answer:
I was just messing around with a crossfade slideshow script yesterday. I used the setTimeout in it and it will loop continuously. Just place this script in the head and call the runSlideShow() with body onload, and give the img tag you want it to appear in an id of “adBanner” or change that in the script to your own id.

Ad Banner

Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkList

This entry was posted on Wednesday, July 16th, 2008 at 3:23 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.

Leave a reply

Name (*)
Mail (*)
URI
Comment