PDA

View Full Version : Blending Image Slideshow Script Delay in the Loop



torgasm
08-18-2010, 07:18 PM
1) Script Title: Blending Image Slideshow Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/image4.htm

3) I was wondering, is there any way to put a delay between the fading?

Meaning, I want it to fade through all the images once, then allow for a delay before it plays all over again instead of a continuous loop. Is that possible?

jscheuer1
08-19-2010, 06:48 AM
Find this code at the end of the second script block:


function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

Make it like so (additions/changes highlighted):


function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
slideit.added_delay = whichimage < slideimages.length - 1? 0 : 3000;
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout(slideit, slidespeed + blenddelay + slideit.added_delay);
}
slideit()

See the red 3000? That will add 3 seconds to the delay when transitioning from the last image to the first (3000 milliseconds = 3 seconds). Adjust as desired.