Skip to content
>GLB_
Go back

50projectsIn50days – Day 14: animated navigation

A navigation bar inside the html is the responsible of hosting the menu li. But, for the example is not necesarry to use explain more about that.

This nav has an event listener which listen for a click. When it happens it will be added elelment active which is the responsible of change the style.

const toggle = document.getElementById('toggle')const nav = document.getElementById('nav')toggle.addEventListener('click', () => nav.classList.toggle('active'))

You can see the code in this GitHub Repository: 14.animated_navigation and the demo of the project is here: Animated Navigation


Share this post:

Previous Post
50projectsIn50days – Day 15: Counter
Next Post
50projectsIn50days – Day 13: Random Picker