Menu Dropdowns not working – Elementor Header Menu on WordPress


Menu Not working on my website

The header is designed using "Elementor – Header, Footer & Blocks" plugin. The dropdown is not working. Tried activating, deactivating plugin, clearing cache.

Website Link:

Header settings

Navigation Menu Settings


Try this below code. code goes in your active theme functions.php file.

function add_custom_js(){
    <script type="text/javascript">
                $('.hfe-has-submenu .hfe-menu-item').on('click',function(e){
                    if( $(this).closest('li').find('.sub-menu').css('opacity') === '0' ){
                        $(this).closest('li').find('.sub-menu').css({"visibility": "visible", "opacity": "1"});
                        $(this).closest('li').find('.sub-menu').css({"visibility": "hidden", "opacity": "0"});
add_action( 'wp_footer', 'add_custom_js', 10, 1 );

Tested and works.

enter image description here

Answered By – Bhautik

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published