Skip to content

Instantly share code, notes, and snippets.

@brenopolanski
Created August 11, 2014 12:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenopolanski/d118d10c130a6597872a to your computer and use it in GitHub Desktop.
Save brenopolanski/d118d10c130a6597872a to your computer and use it in GitHub Desktop.
Effect of loading in page
#loading-page {
background: rgba(204,204,204,.8);
height: 100%;
width: 100%;
overflow: hidden;
position: fixed;
left: 0;
top: 0;
z-index: 99998;
}
#loading-container {
position: fixed;
top: 50%;
left: 50%;
}
#loading-content {
width: 800px;
text-align: center;
margin-top: -50px;
margin-left: -400px;
height: 100px;
}
<div id="loading-page">
<script type="text/javascript">
document.write('<div id="loading-container"><p id="loading-content">' +
'<img src="/img/loading.gif" alt=""></p></div>');
</script>
</div>
function loadingPage() {
setTimeout(function() {
$('div#loading-page').fadeOut(function() {
$(this).remove();
$('body').removeAttr('style');
});
}, 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment