• I have a small jquery part in my footer to open and collapse the menu.

    if(jQuery(‘.current-menu-ancestor’).length == 0) {
    jQuery(‘.sub-menu’).hide();
    }
    jQuery(‘.sub-menu’).closest(‘.menu-item’).children(‘a’).click(function(e){
    jQuery(this).parent(‘.menu-item’).children(‘.sub-menu’).slideToggle();
    e.preventDefault();
    })

    However it only opens and displays the subitems. Is there an easy way to make sure the menu both unfolds and shows the subitems and show the parent item that was clicked?

    I have virtually no experience using Jquery so any help is appreciated

The topic ‘Jquery collapsing menu edit’ is closed to new replies.