From c5aab3de19b99ed47de5a28c962a24c771db6cbf Mon Sep 17 00:00:00 2001 From: AngelJumbo Date: Mon, 3 Jun 2024 14:26:10 -0500 Subject: [PATCH] scroll to selected section --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index c7c8f0c..ccea8c8 100644 --- a/app.js +++ b/app.js @@ -27,7 +27,9 @@ function activeSection(section) { const targetSection = document.getElementById(section); targetSection.style.display = "block"; - targetSection.focus(); + setTimeout(()=>{ + targetSection.scrollIntoView({ block: "start", behavior: "smooth" }); + },100) } function hideAll() {