function elementor_nav_fallback_js() { ?> <script> if (!window.elementorProFrontend){ let navToggle = document.querySelector('.elementor-menu-toggle'); let nav = document.querySelector('nav.elementor-nav-menu--dropdown'); navToggle.addEventListener('click', ElementorNavFallBackFunction); function ElementorNavFallBackFunction(){ if (!window.elementorProFrontend){ navToggle.classList.add('elementor-active'); navToggle.setAttribute('aria-expanded','true'); nav.style.width = '100vw'; nav.style.position = 'fixed'; nav.style.left = '0'; nav.style.top = '58px'; nav.setAttribute('aria-hidden','false'); } navToggle.removeEventListener('click',ElementorNavFallBackFunction); } } </script> <?php } add_action( 'wp_footer', 'elementor_nav_fallback_js');
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter