diff --git a/js/preloader.js b/js/preloader.js index ba96e5b..c2a9a2b 100644 --- a/js/preloader.js +++ b/js/preloader.js @@ -1,11 +1,12 @@ function preloader() { setTimeout((e) => { document.getElementById("preloader").classList.toggle("hidden"); - TopScroll = window.pageYOffset || document.documentElement.scrollTop; - (LeftScroll = window.pageXOffset || document.documentElement.scrollLeft), - // if scroll happens, set it to the previous value - (window.onscroll = function () { - window.scrollTo(LeftScroll, TopScroll); - }); + window.onscroll = function () {}; }, 4000); + TopScroll = window.pageYOffset || document.documentElement.scrollTop; + (LeftScroll = window.pageXOffset || document.documentElement.scrollLeft), + // if scroll happens, set it to the previous value + (window.onscroll = function () { + window.scrollTo(0, 0); + }); }