Skip to content

Instantly share code, notes, and snippets.

@PaulGwamanda
Created February 15, 2017 10:44
Show Gist options
  • Save PaulGwamanda/bbfcb6d27e4dccd72cfea119fcb2ae78 to your computer and use it in GitHub Desktop.
Save PaulGwamanda/bbfcb6d27e4dccd72cfea119fcb2ae78 to your computer and use it in GitHub Desktop.
Add pre-loader before page load
/** Add pre-loader before page load **/
jQuery(document).ready(function ($) {
$(window).load(function () {
// on window load
setTimeout(function() {
//set timeout duration for preloader function
$(function (){
$('#preloader').fadeOut('3000', function () {
// fade out after 3 seconds
$(this).remove();
// then remove
});
});
// delay window load/refresh for duration of 1.5seconds
},"1200");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment