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):
Code:
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):
Code:
. . .
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':
Code:
<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.
Bookmarks