I'm facing a little problem with following solution of Jonathan Sampson: jQuery “Please Wait, Loading…” animation?
I'm using jQuery 2.1.3 and I can't seem to get it work.
$body = $("body");
$(document).ajaxStart(function () {
$("body").addClass("loading");
$('.modal').fadeIn(500);
});
$(document).ajaxStop(function () {
$("body").removeClass("loading");
$('.modal').fadeOut(500);
});
My footer.php looks like this. All links are working and I don't even get an error.
<div class="modal"><!-- Place at bottom of page --></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<script src="js/Magnific-Popup-master/dist/jquery.magnific-popup.js"></script>
<script src="js/kswedberg-jquery-smooth-scroll-dc770ba/jquery.smooth-scroll.js"></script>
<script src="js/main.js"></script>
When I add the "loading" class manually in firebug to my body it is working. So I assume it's an jQuery problem. Would really appreciate some help.