So here is the code
what is worng with it? it should trigger a block if I click on this block (burger) the nav-active function should be triggered. Here is the css part:
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelectorAll('.nav-links');
burger.addEventListener('click',()=>{
nav.classList.toggle('nav-active');
});
}
navSlide();
.nav-active {
transform: translate(0%);
}
I added the javascript file at the end of my html file:
<script src="../static/java_file.js"></script>
Aucun commentaire:
Enregistrer un commentaire