Update 1.js
This commit is contained in:
+11
-4
@@ -246,10 +246,17 @@ window.addEventListener("scroll", () => {
|
|||||||
|
|
||||||
/*when the window is reloading or loading*/
|
/*when the window is reloading or loading*/
|
||||||
window.addEventListener('load', function() {
|
window.addEventListener('load', function() {
|
||||||
const targetElement = document.getElementById('container_1');
|
requestAnimationFrame(() => {
|
||||||
targetElement.scrollIntoView();
|
const targetElement = document.getElementById('container_1');
|
||||||
const sidebarCheckbox = document.getElementById('sidebar-active');
|
if (targetElement) {
|
||||||
if (sidebarCheckbox.checked) {sidebarCheckbox.checked = false;}
|
targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const sidebarCheckbox = document.getElementById('sidebar-active');
|
||||||
|
if (sidebarCheckbox && sidebarCheckbox.checked) {
|
||||||
|
sidebarCheckbox.checked = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user