Geek Logbook

Tech sea log book

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

Leave a Reply

Your email address will not be published. Required fields are marked *.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>