Fixed issue with the mobile navigation not closing when a link was clicked.
This commit is contained in:
1 parent
da2a1f9519
commit
221c5a9bd8
1 file changed
+8
@@ -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 };
|
||||||
|
|||||||
Reference in new issue
Block a user