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?