Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animated GIF Not Working in FireFox after cache

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?

like image 899
ToiletOverflow Avatar asked May 14 '10 03:05

ToiletOverflow


People also ask

Why are GIFs not working on Firefox?

Type "about:config" into your address bar, then press "Enter." Look for the line that says "image. animation_mode" and double-click it. Change the mode to "normal" if it isn't already; if it says "once" or "none," animated GIFs will not load correctly.

Why are my GIFs not animating?

If your GIF file is not playing or looping, it might be because the file is too large. If it's more than 1080 pixels high or 1920 pixels wide, you'll need to reduce the size. There are a number of free, online tools of varying sophistication that you can use.

How do I make GIFs Autoplay in Firefox?

(or enter autoplay in the Find in Settings search box). Click the Settings… button next to Autoplay. Use the Default for all websites drop-down menu to select how you want Firefox to handle media autoplay for all websites.

How do you fix a GIF not playing?

To play animated GIF files, you must open the files in the Preview/Properties window. To do this, select the animated GIF file, and then on the View menu, click Preview/Properties. If the GIF does not play, try re-saving the animated GIF in the collection in which you want to put it.


2 Answers

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="" />

hope that helps

like image 121
Jade O'Connor Avatar answered Sep 17 '22 13:09

Jade O'Connor


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();
like image 29
ToiletOverflow Avatar answered Sep 17 '22 13:09

ToiletOverflow