sigit_design/assets/js/navMobile.js

16 lines
575 B
JavaScript

document.querySelectorAll('.secMainNavInsideSecRightInsideBtnBurger').forEach(button => {
button.addEventListener('click', () => {
const mobileNav = document.querySelector('.secMainNavMobile');
if (mobileNav) {
if (mobileNav.classList.contains('secMainNavMobileShow')) {
mobileNav.classList.remove('secMainNavMobileShow');
document.body.style.overflow = 'auto'; // Enable scroll
} else {
mobileNav.classList.add('secMainNavMobileShow');
document.body.style.overflow = 'hidden'; // Disable scroll
}
}
});
});