From e25cd2b27ec757dd6c53e4d73dbd2c6f342eccba Mon Sep 17 00:00:00 2001 From: "sourabh@32" Date: Tue, 5 Dec 2023 22:22:41 +0530 Subject: [PATCH] Fixed - Close the navbar drawer when a link inside it is clicked --- js/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/index.js b/js/index.js index dc8bf3a..4bde84f 100644 --- a/js/index.js +++ b/js/index.js @@ -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); +}); \ No newline at end of file