loading div
by rwone
HTML
<div id="content">
<!--this stuff takes a long time to load-->
<img src="http://lorempixel.com/1920/1920/">
</div>
<div id="loading">
<!-- this is the loading gif -->
<img src="http://lorempixel.com/400/200/">
</div>
CSS
#content img {
width: 50px;
height: 50px;
}
JavaScript
// when user browses to page
$('#content').hide();
$('#loading').show();
// then when the #content div has loaded
$('#content').bind('load', function() {
$('#loading').hide();
$('#content').fadeIn('slow');
});