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( "#my-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 LI 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.
spacer String "Spacer" The classname on a LI that should be displayed with more whitespace above it.
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".
openingInterval Number 25 The number of milliseconds between opening/closing the menu and panels, needed to force CSS transitions.
panelNodetype Array ["div", "ul", "ol"] List of possible node-type of panels.
transitionDuration Number 400 2 The number of milliseconds used in the CSS transitions.

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