I'm trying to make a preloader, I currently have this code, but it's not showing the preloader before the page loads.
$(document).ready(function(){
$(".preloader-wrapper").show();
$("body").hide();
});
$(window).load(function(){
$(".preloader-wrapper").fadeOut("slow", function(){
$("body").fadeIn("slow");
});
});
EDIT: Got it.
setTimeout(function() {
$('#preloader').fadeOut('slow', function() {
$(this).remove();
});
}, 2000);
#preloader {
position: fixed;
left: 0;
top: 0;
z-index: 999;
width: 100%;
height: 100%;
overflow: visible;
background: #333 url('http://files.mimoymima.com/images/loading.gif') no-repeat center center;
}