thrrgilag.net/themes/binario/static/js/menu.js
Morgan McMillian 022c04d286 new site theme
2019-09-07 12:40:58 -07:00

13 lines
386 B
JavaScript

const toggle = document.getElementById('toggle');
const menu = document.getElementById('menu');
function toggleMenu() {
menu.classList.toggle('main-nav__list--active');
this.classList.toggle('main-nav__btn--active');
this.setAttribute(
'aria-expanded',
this.getAttribute('aria-expanded') === 'true' ? 'false' : 'true'
);
}
toggle.addEventListener('click', toggleMenu, false);