Created
February 15, 2017 10:44
-
-
Save PaulGwamanda/bbfcb6d27e4dccd72cfea119fcb2ae78 to your computer and use it in GitHub Desktop.
Add pre-loader before page load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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