Fix floating buttons

This commit is contained in:
Katy248
2024-06-06 07:09:07 +00:00
parent 0dfad27294
commit 6299537d22
4 changed files with 70 additions and 68 deletions
+4 -2
View File
@@ -26,7 +26,8 @@ function activeSection(section) {
hideAll();
const targetSection = document.getElementById(section);
targetSection.style.display = "block";
targetSection.focus();
targetSection.classList.add("selected");
setTimeout(() => {
targetSection.scrollIntoView({ block: "start", behavior: "smooth" });
}, 100);
@@ -34,7 +35,8 @@ function activeSection(section) {
function hideAll() {
document.querySelectorAll(".section").forEach((s) => {
s.style.display = "none";
s.classList.remove("selected");
// s.style.display = "none";
});
}
const HIDDEN_CLASS = "hidden";