defiance-ng/static/js/nav-toggle-mobile.js

8 lines
No EOL
251 B
JavaScript

function classToggle() {
const navs = document.querySelectorAll('.nav-li')
navs.forEach(nav => nav.classList.toggle('nav-li-show-mobile'));
}
document.querySelector('#nav-toggle-mobile')
.addEventListener('click', classToggle);