PDA

View Full Version : Fade-In slideshow: changing manually



naiad
12-07-2006, 12:07 PM
1) Script Title: Fade-In slideshow

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

3) Describe problem:
What i want is a link that change the current image.
I have this in the javascript:

fadeshow.prototype.change=function(i){
this.nextimageindex=i;
fadearray[0].rotateimage();
}

and this in the body
<a href="#" onClick='fadearray[0].change(2)'>Change photo</a>

With this I call to that function with the number of the image of the array, and the image fade-in normally, but it creates a second setinterval. If you do this and click several times the fades go crazy, like there is a lot of interval functions changing everything.

I've tried clearing the interval (clearInterval(fadeclear[0]);) but it does not work...

Any idea or solution ?

thanx

Twey
12-07-2006, 02:53 PM
See this modification (http://www.twey.co.uk/files/slide.html) of mine. I was originally going to object-orient it properly before suggesting it as a replacement for the original, but it doesn't look like that's going to happen any time soon.