mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-14 10:48:30 +00:00
15 lines
504 B
JavaScript
15 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');
|
||
|
}
|
||
|
});
|