Skip to content

Commit 96521e2

Browse files
committed
Fix preloader to show until user clicks anywhere, instead of hiding immediately on page load.
1 parent 3e29c3a commit 96521e2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

js/menikah.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ function scrollFunction() {
4747
}
4848

4949
// Preloader
50-
$(document).ready(function($) {
50+
// Show preloader until user clicks anywhere
51+
$(window).on("load", function () {
52+
$("body").addClass("preloader-site");
53+
});
54+
55+
// Hide preloader only when user clicks
56+
$(document).one("click", function () {
5157
$(".preloader-wrapper").fadeOut();
5258
$("body").removeClass("preloader-site");
53-
});
54-
$(window).load(function() {
55-
var Body = $("body");
56-
Body.addClass("preloader-site");
57-
});
59+
});

0 commit comments

Comments
 (0)