Title: Jquery collapsing menu edit
Last modified: August 20, 2016

---

# Jquery collapsing menu edit

 *  [Sjaakbonestaak](https://wordpress.org/support/users/sjaakbonestaak/)
 * (@sjaakbonestaak)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/jquery-collapsing-menu-edit/)
 * 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.

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)

 * 0 replies
 * 1 participant
 * Last reply from: [Sjaakbonestaak](https://wordpress.org/support/users/sjaakbonestaak/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/jquery-collapsing-menu-edit/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
