I installed swup NPM package to add some page transitions to my website. But now, after clicking a list item in the menu and navigating to the home page my hamburger menu only works once
I want the menu to work propely.
Here’s the repository if it’s easier. It has all my code “https://github.com/Procoder912/Ritokari”
const swup = new Swup();
const hamMenu = document.querySelector(".ham-menu");
const offScreenMenu = document.querySelector(".off-screen-menu");
hamMenu.addEventListener("click", () => {
hamMenu.classList.toggle("active");
offScreenMenu.classList.toggle("active");
});
I also added overflow: hidden to all the elements because my page was horzontally scrolling and menu was overflowing beyond the width of the page.