I'm trying to make a responsive hamburger menu, however, I've run into a brick wall at the final part of the coding for the menu...
I've tried everything that I can think of trying. For some reason, my menu will not completely disappear or appear at all with the adjustments I've made to the code.
With the final adjustment, the menu is not visible, as I have specified for it not to be in the code, but when I click on the menu button the menu doesn't toggle.
Here is my code:
const ul = document.querySelector('.menu ul');
burger.addEventListener('click', () => {
ul.classList.toggle('change');
});
.menu ul {
position: absolute;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
visibility: hidden;
}
.change {
visibility: visible;
}
.burger {
cursor: pointer;
display: inline-block;
align-items: center;
justify-content: flex-end;
position: fixed;
}
<div class="menu">
<nav>
<ul class>
<li><a href="home.html">Home</a></li>
<li><a href="home.html">Men</a></li>
<li><a href="home.html">Women</a></li>
<li><a href="home.html">Accessories</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
<div class="burger">
<div class="bar"></div>
</div>
</nav>
</div>
Please anything helps :')