How to restart gif animation on a new page?

I did a GIF animation in a few seconds and was not looped. When I put the gif on different pages, the animation does not restart, because it is cached ... it just remains on the last frame. How can I restart it when it is on a new page? I know how to rename it or add "?" to him, but it will give me bandwidth problems.

Any help would be appreciated.

+4
source share
1 answer

I'm not sure if this method will cause the browser to request GIFs from its server a second time, but this forces the GIF animation to restart on the following pages:

Your image:

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

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

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

All Articles