Title: Open Close Menu w/ Javascript
Last modified: April 10, 2018

---

# Open Close Menu w/ Javascript

 *  Resolved [pulketo](https://wordpress.org/support/users/pulketo/)
 * (@pulketo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/)
 * I need to open/close menu and check if is it already opened/closed with javascript
   
   currently I’m opening it with $(“.mob-icon-menu”).trigger(‘click’) but i know
   it is not the correct way…
 * anyone help?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Rui Guerreiro](https://wordpress.org/support/users/takanakui/)
 * (@takanakui)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167412)
 * Hi [@pulketo](https://wordpress.org/support/users/pulketo/),
 * Depending on the menu that you want to open/close you just need to add the following
   class to any html element.
    `mobmenu-left-bt` or `mobmenu-right-bt`
 * [https://cl.ly/3L3s17462343](https://cl.ly/3L3s17462343)
 * it will automatically close if it’s open and vice-versa.
 * Let me know if you made it.
 *  Thread Starter [pulketo](https://wordpress.org/support/users/pulketo/)
 * (@pulketo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167508)
 * Thanks,
    but i need to know it is closed or open
 *  Plugin Author [Rui Guerreiro](https://wordpress.org/support/users/takanakui/)
 * (@takanakui)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167526)
 * sure.
 * For the Left Menu
 *     ```
        if ( $( 'body' ).hasClass( 'show-nav-left') ) {  
   
        }
       ```
   
 * For the Right Menu
 *     ```
        if ( $( 'body' ).hasClass( 'show-nav-right') ) {  
   
        }
       ```
   
    -  This reply was modified 8 years, 1 month ago by [Rui Guerreiro](https://wordpress.org/support/users/takanakui/).
 *  Thread Starter [pulketo](https://wordpress.org/support/users/pulketo/)
 * (@pulketo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167596)
 * thanks!!! that’s exactly what I need, thanks
 *  Plugin Author [Rui Guerreiro](https://wordpress.org/support/users/takanakui/)
 * (@takanakui)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167601)
 * No problem. Glad I could help.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Open Close Menu w/ Javascript’ is closed to new replies.

 * ![](https://ps.w.org/mobile-menu/assets/icon-128x128.png?rev=1890426)
 * [WP Mobile Menu - The Mobile-Friendly Responsive Menu](https://wordpress.org/plugins/mobile-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mobile-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mobile-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/mobile-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mobile-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mobile-menu/reviews/)

## Tags

 * [close](https://wordpress.org/support/topic-tag/close/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [open](https://wordpress.org/support/topic-tag/open/)

 * 5 replies
 * 2 participants
 * Last reply from: [Rui Guerreiro](https://wordpress.org/support/users/takanakui/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/open-close-menu-w-javascript/#post-10167601)
 * Status: resolved