mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-25 15:38:35 +00:00
14 lines
504 B
JavaScript
14 lines
504 B
JavaScript
var toggle = document.getElementById('toggle');
|
|
var menu = document.getElementById('menu');
|
|
|
|
toggle.addEventListener('click', function () {
|
|
if (menu.classList.contains('main-nav__list--active')) {
|
|
this.setAttribute('aria-expanded', 'false');
|
|
this.classList.remove('main-nav__btn--active');
|
|
menu.classList.remove('main-nav__list--active');
|
|
} else {
|
|
menu.classList.add('main-nav__list--active');
|
|
this.classList.add('main-nav__btn--active');
|
|
this.setAttribute('aria-expanded', 'true');
|
|
}
|
|
});
|