Menu widget
Overview
The Magento menu widget is a customized jQuery UI Menu widget. Magento menu extends the default functionality with the following:
- expanding all layers of the menu tree past the second layer
- declaring a responsive menu
- setting hover delay
The Magento menu widget source is lib/web/mage/menu.js.
Initialize the menu widget
For information about how to initialize a widget in a JS component or .phtml
template, see the Initialize JavaScript topic.
Options
Menu widget options mostly coincide with the options of the jQuery UI Menu widget, with addition of the following custom ones:
delay
Set the delay length of opening submenu.
Type: Number
Default value: 300
responsive
Setting the default responsive handler for the navigation widget.
Type: Boolean.
Default value: false
expanded
Display top level navigational items in mobile menu or all items.
Type: Boolean.
Default value: false
Methods and Events
The Magento menu widget has all default jQuery UI menu widget methods and events.