Skip to content

Commit

Permalink
fix script menu burg
Browse files Browse the repository at this point in the history
  • Loading branch information
marina-barbosa committed Jun 22, 2024
1 parent 35e7e05 commit a1c83d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/menu-burgue.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@


const hamburger = document.querySelector(".hamburger");
const nav = document.querySelector("nav");
const navLinks = document.querySelectorAll("nav ul li a");

hamburger.addEventListener("click", () => {
nav.classList.toggle("active");
});

navLinks.forEach(link => {
link.addEventListener("click", () => {
nav.classList.remove("active");
});
});

0 comments on commit a1c83d4

Please sign in to comment.