1document.addEventListener('DOMContentLoaded', () => { 2 // MENU MOBILE 3 function iniciarMenuMobile() { 4 const menuBtn = document.querySelector('.hamb-menu'); 5 const menuPanel = document.getElementById('mobileMenu'); 6 const linksAndButtons = menuPanel.querySelectorAll('a'); 7 if (!menuBtn || !menuPanel) { 8 setTimeout(iniciarMenuMobile, 200); 9 return; 10 } 11 const toggleMenu = (e) => { 12 e.preventDefault(); 13 const isVisible = menuPanel.classList.toggle('visible'); 14 menuBtn.classList.toggle('active', isVisible); 15 // A11y: Actualiza aria-expanded 16 menuBtn.setAttribute('aria-expanded', isVisible ? 'true' : 'false'); 17 }; 18 menuBtn.addEventListener('click', toggleMenu, { passive: false }); 19 menuBtn.addEventListener('touchstart', toggleMenu, { passive: false }); 20 linksAndButtons.forEach(el => { 21 el.addEventListener('click', () => { 22 menuPanel.classList.remove('visible'); 23 menuBtn.classList.remove('active'); 24 menuBtn.setAttribute('aria-expanded', 'false'); 25 }); 26 }); 27 } 28 iniciarMenuMobile(); 29});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.