Animated gifs freeze in firefox 4.0 and above

I use jquery to preload the animated gif, and then insert the message with the animated gif code. It worked fine until version 4.0 of Firefox. since then only the 1st frame and the animation is frozen. (it works fine on IE and chrome)

I use:

$("<img>").attr("src",image); // preload the image 

And later:

 $(message).insertAfter(obj); // inject animated gif and some text 

[EDIT] Added jsfiddle example: http://jsfiddle.net/na2ku/35/

+6
source share
1 answer

Perhaps try pasting an image object into a document instead of adding a simple tag.

 var img = new Image(); img.src = "image.gif"; $(img).insertAfter(message); 
+2
source

Source: https://habr.com/ru/post/899490/


All Articles