hi, i'm trying to make a responsive navigation bar following a tutorial i found on youtube, i've gone through everything, checked multiple times my syntax etc... but i still can't find what the problem is here, i'm trying to make the nav bar appear when i click on it, but i just doesn't work
here's the app.js code:
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () => {
//Toggle Nav
nav.classList.toggle('nav-active');
//Animate Links
navLinks.forEach((link, index) => {
if (link.style.animation) {
link.style.animation = ''
} else {
link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 1.3}s`;
}
});
//Burger Animation
burger.classList.toggle('toggle');
});
}
navSlide();
thanks if anyone could help me to make it work!!
here's the app.js code:
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () => {
//Toggle Nav
nav.classList.toggle('nav-active');
//Animate Links
navLinks.forEach((link, index) => {
if (link.style.animation) {
link.style.animation = ''
} else {
link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 1.3}s`;
}
});
//Burger Animation
burger.classList.toggle('toggle');
});
}
navSlide();
thanks if anyone could help me to make it work!!