I am trying to write a script which displays a loader gif images while the image loads, but none of the images in the page in firefox after including the script. It works fine in chrome. I have included the following code.
Javascript:
<script>
$(window).load(function() {
$('#loader').hide();
$('#best').fadeIn();
});
</script>
HTML:
<body>
<div id="loader"></div>
<div id="best">
<!-- Contents of the page here -->
</div>
</body>
CSS:
#loader {
background: url('img/19-0.gif');
height: 95px;
width: 95px;
position: relative;
top: 50%;
left: 50%;
margin-top: 15em;
margin-left: 13em;
}
#best {
display: none;
}
Is there any problems in my code or should I try an alternative approach?