Skip to content

Instantly share code, notes, and snippets.

@beardlessman
Created July 13, 2017 08:09
Show Gist options
  • Save beardlessman/d6d0dc61b88b0650af41c9371782d099 to your computer and use it in GitHub Desktop.
Save beardlessman/d6d0dc61b88b0650af41c9371782d099 to your computer and use it in GitHub Desktop.
Loader
// js
var a = $(".loader"),
d = a.find(".anim");
d.fadeOut(), a.delay(300).fadeOut("slow");
setTimeout(function(){
$(".page").css("opacity",'1');
}, 500);
// html
<div class="loader">
<div class="contpre">
<span class="anim"></span>
</div>
</div>
//css
.loader {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: #ffffff;
z-index: 300000;
}
.loader .anim {
position: absolute;
background: url(../img/loader.gif) center center no-repeat;
width: 120px;
height: 80px;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment