Close mobile nav when nav link is clicked
This commit is contained in:
parent
2e91bd6b70
commit
078329e7bc
1 changed files with 7 additions and 0 deletions
|
@ -64,4 +64,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
mobileNav.classList.remove("active");
|
||||
}
|
||||
})
|
||||
|
||||
const mobileNavLinks = mobileNav.querySelectorAll("a");
|
||||
mobileNavLinks.forEach(link => {
|
||||
link.addEventListener("click", () => {
|
||||
mobileNav.classList.remove("active");
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue