Configuration

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
classNames
{
divider String "Divider" The classname on a listitem that should be displayed as a divider.
nolistview String "NoListview" The classname on an UL that should not be displayed as a listview.
nopanel String "NoPanel" The classname on an element (for example a DIV) that should not be considered to be a panel.
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 a LI that should be displayed as selected.
vertical String "Vertical" The classname on a nested UL that should expand below their parent.
}
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.
}