withfront
Version:
Tools for frontend development especially with Bootstrap 3.x and jQuery 3.x also FontAwesome, jsCookie and more
30 lines (26 loc) • 1.11 kB
JavaScript
$(".loader-wrapper-close").show().click(function () {
$(".loader:not(.demo-loader)").fadeOut(200);
$(".loader-wrapper:not(.demo-loader)").delay(100).fadeOut(400);
});
/* jQuery plugins and other thing that need to be run after the document is load */
$(document).ready(function () {
// this is for loader
if ($(".loader-wrapper").length > 0) {
$('#mainMenu a:not([target="_blank"]):not([href^="#"]), a.animation-link').on("click", function () {
// Grab the link's href
var href = this.href;
$(".loader").fadeIn(300);
// Slide up the content you want to slide up
$(".loader-wrapper").fadeIn(function () {
// Slide is finished, navigate
location.href = href;
});
// Prevent the default action of the link
return false;
});
$(window).on('load', function () {
$(".loader:not(.demo-loader)").fadeOut(200);
$(".loader-wrapper:not(.demo-loader)").delay(100).fadeOut(400);
});
}
});