PDA

View Full Version : Ultimate Fade-in slideshow (v1.5): stop the slide show at the end



Heinz
12-12-2005, 04:43 PM
Hello
Can somebody help me? I tried out the Ultimate Fade-in slideshow and I think it is really great. My question is:
Is there a possibility to stop the slideshow automatically as soon as the last picture is displayed?
Thank you in advance for answers.
Heinz

jscheuer1
12-12-2005, 07:22 PM
To preserve the multiple shows feature of this script and have an option for any given one to stop after one time through, make these modifications -

to the function 'fadeshow' (additions red):


function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, onetime, displayorder){
this.flag=0
this.onetime=onetime
this.pausecheck=pause
this.mouseovercheck=0
. . .

to the function 'fadepic' (near its end):


. . .
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
if(obj.flag&&obj.onetime)
return;
if(obj.nextimageindex==obj.postimages.length-1)
obj.flag=1
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}

Now the syntax for invoking any given slideshow instance has an added parameter - 'onetime':


<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), onetime (0=continuous, 1=one time), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, 1, "R")

</script>

In the above example, the slideshow invoked will stop at the last image. If the red 1 were set to 0, it would run continuously.

Heinz
12-13-2005, 09:25 AM
Dear John
Thank you very much. The modifications work fine.
Heinz

mdiaz38
08-19-2008, 10:05 PM
Hello. I tried the modifications but my slideshow still loops http://www.cffit.com . Here is my fadepic portion and I do have the onetime setting set to '1' as opposed to '0':

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
if(obj.flag&&obj.onetime)
return;
if(obj.nextimageindex==obj.postimages.length-1)
obj.flag=1
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}

Thanks for your help. :)

mdiaz38
08-19-2008, 10:18 PM
Never mind, I figured it out. Thanks - great script and mods.

retoocs
11-12-2008, 05:18 PM
Great addition to this script! Worked perfectly.

cathalob
08-24-2009, 12:53 PM
Can anyone advise, I want the ultimate fade to run once and then automatically go to another html page, can anyone advise how this can be done. I can alway put a link message anyway.... Skip intro... but I would like it, if the fade slideshow would finish and go automatically to the main homepage

Any help great appreciated.

Cathal