Display Loading Graphic Until Page Fully Loaded

Avatar of Chris Coyier
Chris Coyier on
<!DOCTYPE html>
<html class="no-js">

	<meta charset='UTF-8'>
	<title>Simple Loader</title>
		/* This only works with JavaScript, 
		   if it's not present, don't show loader */
		.no-js #loader { display: none;  }
		.js #loader { display: block; position: absolute; left: 100px; top: 0; }
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
	<script src="https://github.com/Modernizr/Modernizr/raw/master/modernizr.js"></script>
		// Wait for window load
		$(window).load(function() {
			// Animate loader off screen
				top: -200
			}, 1500);

	<img src="download.png" id="loader">
	<img src="//farm6.static.flickr.com/5299/5400751421_55d49b2786_o.jpg">