views:

232

answers:

5

I have an animated GIF that loops three times. I have noticed in Firefox and Chrome (haven't checked others) that I can view the GIF once and then if I reload the page, the cached GIF is not animated at all.

Is there a solution to this? Is there something about the animated GIF that I could change to prevent this from occurring?

A: 

Could you point us to the GIF in question? Does it happen with all GIFs you use? All made with the same application?

Anyway, just don't cache and voila, solved. But I think you should use another application to create your GIF and see if it works correctly.

Camilo Martin
A: 

The solution I chose in this case was to append a GET variable to the end of the graphic name, preventing the graphic from being reloaded from cache when the page refreshes.

var myImg = new Image();
myImg.src = "image.gif?rnd=" + Math.random();
ToiletOverflow
A: 

In Firefox, you can force a full reload (reload the cache) with Ctrl+Shift+R or Ctrl+F5.

In Chrome, it's Ctrl+F5 or Shift+F5.

Corey
A: 

Its a super ugly solution but you could use this if your calling the image inline, not pretty but it works!

img src="filename.gif?rand=<#?=rand(1,1000);?>" alt=""

wrap the line in < and /> and remove the # symbol in middle of line (its just there to get past stackO's spam filter).

hope that helps

Jade O'Connor