6

I'm using jquery to preload an animated gif and later on inject a message with animated gif to the code. it used to work fine until release 4.0 of firefox. since then only the 1st frame is showed and the animation is frozen. (it works fine on IE and chrome)

I use:

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

And later on:

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

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

Nir
  • 1,608
  • 1
  • 17
  • 29
  • Please show us your code through jfiddle. Please check this: `http://api.jquery.com/insertAfter/``http://www.w3schools.com/jquery/html_insertafter.asp` – linguini Oct 19 '11 at 10:15
  • 1
    Firefox simply freeze animations when the document location is changed. As you inject it upon form submission, it means the document location is changed to the form action. Consider using AJAX instead. – Shadow The GPT Wizard Dec 07 '11 at 12:52
  • 1
    Thanks for the technical explanation. Using AJAX is not an option in this case. – Nir Dec 07 '11 at 23:08

1 Answers1

2

Maybe try inserting image object into the document instead of adding simple tag.

var img = new Image();
img.src = "image.gif";
$(img).insertAfter(message);
biphobe
  • 4,525
  • 3
  • 35
  • 46