Skip to content

Instantly share code, notes, and snippets.

@technoknol
Created March 12, 2014 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save technoknol/9502804 to your computer and use it in GitHub Desktop.
Save technoknol/9502804 to your computer and use it in GitHub Desktop.
Show Loader while page loads
<!--
* Author : TechnoKnol
* Description : Show Loader while Page Loads Completely
*
*
*
-->
<!-- Add below DIV right after <body> -->
<div id="spinner"></div>
<!-- Add below code right before </head> -->
<!-- Include jQuery if it's not already in your <head> -->
<script type="text/javascript">
jQuery(window).load(function() {
jQuery("#spinner").fadeOut("slow");
});
</script>
<!-- Add below code in your stylesheet -->
<!-- Put any loader in your website Directory and change name and path in style (#spinner) according to image file. -->
<style type="text/css">
#spinner {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('loader.gif') 50% 50% no-repeat #fff;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment