From 221c5a9bd80fe13c74749cf81950cb8bb6d8060e Mon Sep 17 00:00:00 2001 From: blake Date: Thu, 20 Nov 2025 09:05:15 -0600 Subject: [PATCH] Fixed issue with the mobile navigation not closing when a link was clicked. --- script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script.js b/script.js index 99f3501..fee5a09 100644 --- a/script.js +++ b/script.js @@ -34,6 +34,14 @@ btnNavEl.addEventListener("click", function () { headerEl.classList.toggle("nav-open"); }); +const navLinks = document.querySelectorAll(".main-nav-link"); + +navLinks.forEach((link) => { + link.addEventListener("click", () => { + headerEl.classList.remove("nav-open"); + }); +}); + // Scroll Animations document.addEventListener("DOMContentLoaded", () => { const observerOptions = { root: null, rootMargin: "0px", threshold: 0.75 };