<!-- Preloader -->
<div id="preloader">
<div id="status"> </div>
</div>
<!-- Preloader fine -->
<!-- Libreria jQuery -->
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
Codice CSS:
* {
padding:0;
margin:0;
}
#preloader {
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
background-color:#c4ebe8;
z-index:99999;
}
#status {
width:400px;
height:300px;
position:absolute;
left:50%;
top:50%;
background-image:url(http://i.imgur.com/MSzY4fK.gif);
background-repeat:no-repeat;
background-position:center;
margin:-150px 0 0 -200px;
}
Codice JS:
// inserire nel HEAD tra i tag SCRIPT
$(window).load(function() {
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
$('body').delay(350).css({'overflow':'hidden'});
})