Title: Menu Toggle javascript function
Last modified: October 27, 2020

---

# Menu Toggle javascript function

 *  Resolved [Liz](https://wordpress.org/support/users/lizery/)
 * (@lizery)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/menu-toggle-javascript-function/)
 * I am trying to fire the MMM on mobile using my toggle button but I can’t get 
   the javascript to open or close the menu. I have a click function on my toggle
   button and the function:
 *     ```
       current_menu = jQuery('ul#mega-menu-main');
       current_menu.data('maxmegamenu').showMobileMenu();
       ```
   
 * I have a console log in there too and that is firing, so I know it’s being seen,
   but the menu does nothing. Is this possible with the pro version?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Liz](https://wordpress.org/support/users/lizery/)
 * (@lizery)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/menu-toggle-javascript-function/#post-13588582)
 * I figured it out. For anyone looking, I triggered the default toggle with `jQuery('.
   mega-menu-toggle').trigger("click");` and hid it with css.

Viewing 1 replies (of 1 total)

The topic ‘Menu Toggle javascript function’ is closed to new replies.

 * ![](https://ps.w.org/megamenu/assets/icon-128x128.png?rev=1489843)
 * [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/megamenu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/megamenu/)
 * [Active Topics](https://wordpress.org/support/plugin/megamenu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/megamenu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/megamenu/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Liz](https://wordpress.org/support/users/lizery/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/menu-toggle-javascript-function/#post-13588582)
 * Status: resolved