From dacc67758a9ad9f961980d40f2f3f66a54cff716 Mon Sep 17 00:00:00 2001 From: Jasleen1210 <05kaur.j@gmail.com> Date: Sun, 4 Aug 2024 23:54:50 +0530 Subject: [PATCH] Load once --- js/script.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 857cf21..51fccd7 100644 --- a/js/script.js +++ b/js/script.js @@ -850,7 +850,16 @@ var loader = document.querySelector(".loader"); window.addEventListener('load', () => { var backToTopBtn = document.getElementById("backToTopBtn"); backToTopBtn.style.display = "none"; - setTimeout(effect, 4000); + if(!sessionStorage.getItem('load')){ + setTimeout(effect, 4000); + } + else{ + effect(); + const modal = document.getElementById("warningModal"); + modal.style.display='none'; + document.querySelector(".navMain").style.visibility = "visible"; + } + sessionStorage.setItem('load', true); }) function changeColor() {