Title: Jquery code for sidebar
Last modified: August 21, 2016

---

# Jquery code for sidebar

 *  [rmetfd](https://wordpress.org/support/users/rmetfd/)
 * (@rmetfd)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jquery-code-for-sidebar/)
 * Hi
 * I’m trying to use this piece of jquery code to enable a dropdown sidebar menu.
   However, it is currently coded for a primary menu. How would I modify this for
   my sidebar menu?
 *     ```
       <script type="text/javascript">
       function mainmenu(){
       jQuery(" #primary_nav li").hover(function(){
       jQuery(this).find('ul:first').slideDown("slow");
       },function(){
       jQuery(this).find('ul:first').slideUp("slow");
       });
       }
       jQuery(document).ready(function(){
       mainmenu();
       });
       </script>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [rmetfd](https://wordpress.org/support/users/rmetfd/)
 * (@rmetfd)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jquery-code-for-sidebar/#post-4019279)
 * for example, do I change ‘#primary_nav li’ to ‘#menu-item li’ or ‘#sub-menu li’?

Viewing 1 replies (of 1 total)

The topic ‘Jquery code for sidebar’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [rmetfd](https://wordpress.org/support/users/rmetfd/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/jquery-code-for-sidebar/#post-4019279)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
