Skip to content

Instantly share code, notes, and snippets.

@owngeek
Created September 20, 2016 09:30
Show Gist options
  • Save owngeek/e98cd20a6f5dd7e794907f098ebcc7a6 to your computer and use it in GitHub Desktop.
Save owngeek/e98cd20a6f5dd7e794907f098ebcc7a6 to your computer and use it in GitHub Desktop.
Jquery Loader
<style>
.no-js #loader { display: none; }
.js #loader { display: block; position: absolute; left: 100px; top: 0; }
.se-pre-con {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url(http://smallenvelop.com/wp-content/uploads/2014/08/Preloader_11.gif) center no-repeat #000;
}
</style>
<div class="se-pre-con"></div>
Simple PreLoader
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
//paste this code under head tag or in a seperate js file.
// Wait for window load
$(window).load(function() {
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment