Options introduction

The jQuery.mmenu plugin provides a set of options for customizing your menu. The default values can be overridden by passing new values to the method.

<script type="text/javascript">
   $(document).ready(function() {
      $("#my-menu").mmenu({
         // options
      });
   });
</script>

Options are considered to be arbitrary and can be changed without breaking the plugin.

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

Example

Give it a go, change the options below and see how it affects the menu in the example on the right.

  • Use sliding submenus.
<script type="text/javascript">
   jQuery(document).ready(function( $ ) {

   });
</script>

Available options

Option Default value Datatype Description
1 See the description.
2 Option can also be a function that returns a valid value. Inside this function this refers to a logic HTML element.
extensions [] Array A collection of extension names to enable for the menu.
You'll need this option when using the extensions.
initMenu Called before the menu is initiated.
(
$menu jQuery The menu
$orig jQuery The original menu (when clone: true).
)
initPanels Called before the panels are (re)initiated.
(
$panels jQuery The panel(s) to (re)initiate.
)
navbar
{
add true Boolean Whether or not to add a navbar above the panels.
title "Menu" String The title above the main panel.
titleLink "parent" String The type of link to set for the title.
Possible values: "parent", "anchor" or "none".
}
onClick
{
close null 1 Boolean 2 Whether or not the menu should close after clicking a link inside it.
The default value varies per link: true if the default behavior for the clicked link is prevented, false otherwise.
preventDefault null 1 Boolean 2 Whether or not to prevent the default behavior for the clicked link.
The default value varies per link: true if its href is equal to or starts with a hash (#), false otherwise.
setSelected true Boolean 2 Whether or not the clicked link should appear as "selected".
}
slidingSubmenus true Boolean Whether or not submenus should come sliding in from the right. If false, submenus expand below their parent.
To expand a single submenu below its parent item, add the class "Vertical" to it.