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