You are here: irt.org | FAQ | JavaScript | Image | Q718 [ previous next ]
If its an animated gif, then it might be possible. IIRC one browser triggers an onLoad event for the image for every image "frame" loaded. You could trap the onLoad event using the onLoad event handler, count them and work out when the image has finished animating:
<SCRIPT LANGUAGE="JavaScript"><!-- var myCount = 0; var maxCount = 10; function counter() { myCount++; if (myCount > maxCount) alert('Finished'); } //--> <IMG SRC="animated.gif" onLoad="counter()" WIDTH="100" HEIGHT="100">