Change script

This commit is contained in:
Maria Rushkova 2021-08-05 17:42:11 +02:00
parent a1649b40e1
commit 85f6d23fc2
1 changed files with 3 additions and 15 deletions

View File

@ -16,22 +16,10 @@ const closeMobileMenu = () => {
overlay.classList.toggle("hidden");
};
burger.addEventListener("click", function (e) {
closeMobileMenu();
});
overlay.addEventListener("click", function (e) {
closeMobileMenu();
});
burger.addEventListener("click", closeMobileMenu);
overlay.addEventListener("click", closeMobileMenu);
menuLinks.forEach(function (link) {
link.addEventListener("click", function (e) {
const id = e.target.getAttribute("href");
document.querySelector(id).scrollIntoView({
behavior: "smooth",
});
});
closeMobileMenu();
link.addEventListener("click", closeMobileMenu);
});
form.addEventListener("submit", function (e) {