Configuration introduction

Besides the options object, there is a second object passed to the method used for overriding the default configuration options. The default values can be overridden by passing new values to the method.

<script>
    document.addEventListener(
        "DOMContentLoaded", () => {
            new Mmenu( "#menu", {
                // options
            }, {
                // configuration
            });
        }
    );
</script>

Configuration options are less arbitrary than the options, changing them can make or break the plugin.

Note that add-ons might have their own set of configuration options grouped in an object in the configuration.

Available configuration options

Option Datatype Default value Description
1 Requires the listview extension.
2 The value should match the related CSS value.
classNames
{
divider String "Divider" The classname on a listitem that should be displayed as a divider.
inset String "Inset" 1 The classname on a submenu (a nested UL) that should be displayed as a default list.
panel String "Panel" The classname on an element (for example a DIV) that should be considered to be a panel.
selected String "Selected" The classname on the LI that should be displayed as selected.
vertical String "Vertical" The classname on a submenu (a nested UL) that should expand below their parent instead of slide in from the right.
}
language String "en" The language to translate the menu to. Currently supported languages: "de", "en", "fa", "nl", "ru".
panelNodetype Array ["div", "ul", "ol"] List of possible node-type of panels.
screenReader
{
closeSubmenu String "Close submenu" Screenreader text for buttons that close a submenu.
openSubmenu String "Open submenu" Screenreader text for buttons that open a submenu.
toggleSubmenu String "Toggle submenu" Screenreader text for buttons that toggle a submenu.
}

Note that add-ons might have their own set of configuration options.