Entry
I preload an animated non looping gif in NN4. When I swap it in only the last frame is shown. What can I do to prevent that?
Dec 24th, 2000 10:08
Martin Honnen,
NN4 has a bug when displaying an animated non looping gif which has
been preloaded. It justs displays the last frame of the animation
instead of restarting it.
The following function works around that by temporarily assigning a 1x1
transparent image to the Image object which seems to cause a restart of
the animation when you swap the animated image in.
<SCRIPT>
var img = new Image();
img.src = 'animatedImage.gif';
function changeAnimatedImage (imageName, image) {
var imgSrc = image.src;
img.src = '1x1transparent.gif';
document[imageName].src = imgSrc;
image.src = imgSrc;
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF="javascript: void 0"
ONMOUSEOVER="changeAnimatedImage('imageName', img);"
><IMG NAME="imageName" SRC="staticImage.gif" BORDER="0"></A>
</BODY>