2023-08-28 07:52:05 +00:00
|
|
|
var isHidenUL = true;
|
|
|
|
|
|
|
|
function toggleMobileMenu(event) {
|
2023-11-02 14:55:57 +00:00
|
|
|
event.stopPropagation();
|
2023-08-28 07:52:05 +00:00
|
|
|
|
|
|
|
let hidenUL = document.querySelector('#mobile_menu');
|
|
|
|
|
2023-11-02 14:55:57 +00:00
|
|
|
/* console.log('click event => toggleMobileMenu called');
|
|
|
|
console.log(hidenUL) */
|
2023-08-28 07:52:05 +00:00
|
|
|
|
|
|
|
if (hidenUL && isHidenUL) {
|
|
|
|
hidenUL.style.display = 'block';
|
|
|
|
isHidenUL = false;
|
|
|
|
} else if (hidenUL && !isHidenUL) {
|
|
|
|
hidenUL.style.display = 'none';
|
|
|
|
isHidenUL = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-09-04 15:49:32 +00:00
|
|
|
function hideMobileMenu(event) {
|
|
|
|
|
|
|
|
let hidenUL = document.querySelector('#mobile_menu');
|
|
|
|
|
2023-11-02 14:55:57 +00:00
|
|
|
/* console.log('click event => toggleMobileMenu called')
|
|
|
|
console.log(hidenUL) */
|
|
|
|
|
2023-09-04 15:49:32 +00:00
|
|
|
|
|
|
|
if (hidenUL && !isHidenUL) {
|
|
|
|
hidenUL.style.display = 'none';
|
|
|
|
isHidenUL = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-08-28 07:52:05 +00:00
|
|
|
let elEvent = document.querySelector('#et_mobile_nav_menu');
|
|
|
|
|
2023-11-02 14:55:57 +00:00
|
|
|
console.log(elEvent)
|
2023-08-28 07:52:05 +00:00
|
|
|
|
|
|
|
if (elEvent) {
|
|
|
|
document.querySelector('#mobile_menu').style.display = 'none';
|
|
|
|
elEvent.addEventListener("click", toggleMobileMenu);
|
2023-09-04 15:49:32 +00:00
|
|
|
document.querySelector("body").addEventListener("click", hideMobileMenu);
|
2023-08-28 07:52:05 +00:00
|
|
|
}
|