Skip to content

Instantly share code, notes, and snippets.

@mahbubme
Last active February 6, 2019 18:14
Show Gist options
  • Save mahbubme/9ab86ca50ad51a48a9d0 to your computer and use it in GitHub Desktop.
Save mahbubme/9ab86ca50ad51a48a9d0 to your computer and use it in GitHub Desktop.
Simple preloader jQuery script and CSS for web page layout.
$(document).ready(function() {
// Preloading
var div_box = "<div id='load-screen'><div id='loading'></div></div>";
$("body").prepend(div_box);
$('#load-screen').delay(700).fadeOut(600, function(){
$(this).remove();
});
});
#load-screen {
background: url(../images/header-back.png);
position: fixed;
z-index: 10000;
top: 0;
width: 100%;
height: 1600px;
}
#loading {
width: 500px;
height: 500px;
margin: 10% auto;
background: url(../images/loader.gif);
background-size: 40%;
background-repeat: no-repeat;
background-position: center;
z-index: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment