views:

26

answers:

1

I made a GIF animation running for a few seconds, and is not looped. When I put the gif on different pages, the animation does not restart because its cached... it just stays on the last frame. How can I make it restart when it is on a new page? I know of ways how to rename it or add "?" to it, but it will give me bandwidth issues.

Any help would be appreciated.

A: 

I'm not sure if this method will cause the browser to request the GIF from your server a second time, but this should force the GIF animation to restart on subsequent pages:

Your image:

<img id="animatedgif" src="picture.gif">

And at the bottom of the page, near the closing BODY and HTML tags:

<script type="text/javascript">
    document.getElementById("animatedgif").src = "";
    document.getElementById("animatedgif").src = "picture.gif";
</script>
Jeff