Skip to content

Commit

Permalink
correction loader timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bmiit145 committed Mar 1, 2024
1 parent bc3bbaa commit 3b525fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@
// loader();

window.addEventListener("load", function() {
// Hide the loader when the page has finished loading
var loader = document.querySelector("#ftco-loader");

// Set a timeout to hide the loader after 5 seconds
setTimeout(function() {
var timeoutId = setTimeout(function() {
loader.style.display = "none";
}, 5000);
loader.style.display = "none";

});
// Clear the timeout if the page finishes loading before 5 seconds
window.addEventListener("load", function() {
clearTimeout(timeoutId);
loader.style.display = "none";
});
});


// Scrollax
Expand Down

0 comments on commit 3b525fd

Please sign in to comment.