JavaScript API

jQuery events are fired each time a flyout or mega menu is open and closed. The events are “open_panel” and “close_panel”. You can also manipulate the menu (open and close sub menus) using JavaScript.

A plugin is available which demonstrates the possibilities of interacting with the menu using jQuery:

  1. Download this plugin: megamenu-custom-js
  2. Go to Plugins > Add New > Upload and select the megamenu-custom-js zip file
  3. Activate the plugin
  4. In Chrome, right click on the page and click ‘Inspect’. In the Console Tab you should see messages being posted when you click menu items, this means the plugin is working.
  5. Go to Plugins > Editor and select “Max Mega Menu – Custom JS” from the drop down selector.
  6. Select the ‘script.js’ file on the right and edit the file to suit your requirements.


Detect when a sub menu for a specific menu item is opened:

Detect when a sub menu for a specific menu item is closed:
Detect when any sub menu is opened:
Close all open sub menus:
Close a single sub menu:
Open a single sub menu:

Related Articles