Skip to content

Commit

Permalink
Merge pull request #637 from sourabh32/main
Browse files Browse the repository at this point in the history
Fixed - Close the  navbar drawer (in mobile)  when a link inside it is clicked
  • Loading branch information
Susmita-Dey authored Jan 12, 2024
2 parents 8786b54 + e25cd2b commit 2cd5875
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 2cd5875

Please sign in to comment.