Fixed issue with the mobile navigation not closing when a link was clicked.

This commit is contained in:
blake committed 2025-11-20 09:05:15 -06:00
1 parent da2a1f9519
commit 221c5a9bd8
1 file changed
+8
+8
View File
@@ -34,6 +34,14 @@ btnNavEl.addEventListener("click", function () {
headerEl.classList.toggle("nav-open"); 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 // Scroll Animations
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
const observerOptions = { root: null, rootMargin: "0px", threshold: 0.75 }; const observerOptions = { root: null, rootMargin: "0px", threshold: 0.75 };