
Originally Posted by
encrypted
1) Script Title: fadeshow
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...nslideshow.htm
Can I stop fadeshow at anytime? Lets say I have fadeshow in the [ div ] and contents of this [ div ] must be replaced with something else - but before that I need to stop fadeshow. Otherwise I get JS errors.
Thank you.
Modify the script here (in function fadeshow()):
Code:
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("if(fadearray){fadearray["+this.slideshowid+"].rotateimage()}", this.delay)
here:
Code:
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+")"
}
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{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
if(fadearray)
setTimeout("if(fadearray){fadearray["+obj.slideshowid+"].rotateimage()}", obj.delay)
}
}
and here (in fadeshow.prototype.rotateimage=function()):
Code:
fadeclear[this.slideshowid]=setInterval("if(fadearray){fadepic(fadearray["+this.slideshowid+"])}",50)
Then you can stop all slide shows on a page with this:
Bookmarks