Skip to content

Instantly share code, notes, and snippets.

@kovtunos
Last active September 29, 2017 14:26
Show Gist options
  • Save kovtunos/bc7f77f1caa48d77af210ede2ea783e3 to your computer and use it in GitHub Desktop.
Save kovtunos/bc7f77f1caa48d77af210ede2ea783e3 to your computer and use it in GitHub Desktop.
Page preloader #jquery #html #css
<!-- html inline -->
<style>
body {
overflow: hidden;
}
#preloader {
background-color: #fff;
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 99;
}
#status {
background-image: url('images/status.gif');
background-position: center;
background-repeat: no-repeat;
height: 200px;
left: 50%;
margin: -100px 0 0 -100px;
position: absolute;
top: 50%;
width: 200px;
}
</style>
<!-- html after <body> -->
<div id="preloader">
<div id="status">&nbsp;</div>
</div>
<!-- html before </body> -->
<script type="text/javascript">
$(window).load(function() {
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
$('body').delay(350).css({'overflow':'visible'});
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment