[Javascript] Can I tell when an animated Gif is finished?

spacific at paradise.net.nz spacific at paradise.net.nz
Fri Jan 4 22:18:09 CST 2002


>No, there is no event for that. I think you should use a slideshow-like 
>script to show the frames of the animation instead of putting them all in 
>one animated gif. Then you know for sure when it's finished.
>
>ppk


Thanks PPK,

Worth trying, except for having to load all those individual gifs! 

However, from an initial experiment I just tried, a slideshow just does not work, neither Netscape (6.2 or 4.7) nor IE (5.1) actually display anything except the last frame. Looks like they wait for idle time before drawing anything, and that only happens after that last src replacement.

Or am I using the wrong sort of delay here?  I am assigning src, then waiting 1/10 sec, then assigning src again, waiting 1/10 sec, ...  where each wait is done by reading the time and then using a loop until the new time is the start time + 100 millisecs.  Is there some other way, perhaps setting a timer?

Thanks again.

John






More information about the Javascript mailing list