Skip to content

Commit

Permalink
Fixed - Close the navbar drawer when a link inside it is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh32 committed Dec 5, 2023
1 parent 037a7cb commit e25cd2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ const backTop = () => {

backTopElement.addEventListener("click", backTop);
ham.addEventListener("click", toggleMenu);

// Close the drawer when a link inside it is clicked
document.querySelectorAll('.menu a').forEach(link => {
link.addEventListener('click',toggleMenu);
});

0 comments on commit e25cd2b

Please sign in to comment.