binario/static/js/menu.js

12 lines
353 B
JavaScript
Raw Normal View History

2018-04-01 12:56:28 +00:00
var toggle = document.getElementById('toggle');
var menu = document.getElementById('menu');
toggle.addEventListener('click', function () {
2018-10-30 11:25:25 +00:00
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'
);
2018-04-01 12:56:28 +00:00
});