2

For some reason my loading gif is not animating (though the actual image, when not on the page, does animate.) The following is the code I'm using:

<script type="text/javascript">
jQuery(function( $ ){
function preLoad() {
    $("#container").addClass("hidden");
}

function loaded() {
    $("#container").removeClass("hidden");
    $('div#preLoader').css({display:'none'}).remove();
}

preLoad();
window.onload=loaded;
});

<div id="preLoader">
Loading...<br />
<img src="images/site/ajax-loader.gif" />
<br />

This is happening on both IE 9 and FireFox. I don't get why an animated image would stop functioning, just because of JavaScript. Any ideas?

dihakz
  • 557
  • 1
  • 15
  • 30
  • I know that IE doesn't animate GIF when loading the page, but it should be fine with FF. Try >> http://stackoverflow.com/questions/1803610/ie7-ie8-and-frozen-animated-gifs < – Selvakumar Arumugam May 03 '13 at 14:46
  • I was wondering that about IE, but then how does IE display AJAX loaders when the page is still loading? Even so, why would it not work in FF? I know I've seen it work. – dihakz May 03 '13 at 14:59
  • When making an AJAX call, the browser doesn't really refresh the page.. The XMLHTTP request is sent behind the scene. – Selvakumar Arumugam May 03 '13 at 15:02

0 Answers0