How to detect the end of an animated .Gif image in JavaScript?

I need to detect the end of a non-looping .Gif animation and act on it. In other words, when the animation reaches its last frame, I want it to trigger a function in JavaScript. Is there any way to do this?

I think the previous poster is right that there is no way to access the individual frames in an animated GIF image. Maybe as a workaround, if you know how long the animation runs for, you can setup a javascript timer to fire after that number of seconds.

2 Responses to “How to detect the end of an animated .Gif image in JavaScript?”

  1. Adam Says:

    There is no way to access the individual frames of an animated .GIF in javascript.
    References :
    http://lists.evolt.org/pipermail/javascript/2001-May/000553.html

  2. mti2935 Says:

    I think the previous poster is right that there is no way to access the individual frames in an animated GIF image. Maybe as a workaround, if you know how long the animation runs for, you can setup a javascript timer to fire after that number of seconds.
    References :

Leave a Reply