From 26f19c3bd6cbef208d3e31a24aff27e9342031ac Mon Sep 17 00:00:00 2001 From: FURK4NGG <105324908+FURK4NGG@users.noreply.github.com> Date: Sun, 30 Mar 2025 10:03:13 +0300 Subject: [PATCH] Update 1.js --- JAVASCRIPT/1.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/JAVASCRIPT/1.js b/JAVASCRIPT/1.js index f15538e..59ef279 100644 --- a/JAVASCRIPT/1.js +++ b/JAVASCRIPT/1.js @@ -246,12 +246,9 @@ window.addEventListener("scroll", () => { /*when the window is reloading or loading*/ window.addEventListener('load', function() { - requestAnimationFrame(() => { - const targetElement = document.getElementById('container_1'); - if (targetElement) { - targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); - } - }); + setTimeout(() => { + window.scrollTo({ top: 0, behavior: 'smooth' }); + }, 50); const sidebarCheckbox = document.getElementById('sidebar-active'); if (sidebarCheckbox && sidebarCheckbox.checked) {