I am trying to fade in the whole page after its loaded,
my code:
<script type="text/javascript">
$(window).bind("load", function() {
$('#overlay').fadeOut(function() {
$('html').fadeIn();
});
});
</script>
<html style="display:none">
....
<body>
.....
</body>
</html>
<div id="overlay">
<img src="ajax-loader.gif" alt="Loading" />
Loading...
</div>
The problem is the loading image doesn’t show
what should I do?
The loader is in the HTML block, which has display:none. So it won’t display. (even though you put it outside of it)
Instead, create a container DIV with display:none, hide that & fade it in, instead of the HTML.