To make a menu item appear "selected" onMouseOver or when opening its subpanel,
include the "setSelected" add-on .js and .css files and use the setSelected
options.
<head> <script src="path/to/jquery.js"></script> <script src="path/to/jquery.mmenu.js"></script> <script src="path/to/jquery.mmenu.setselected.js"></script> <link href="path/to/jquery.mmenu.css" rel="stylesheet" /> <link href="path/to/jquery.mmenu.setselected.css" rel="stylesheet" /> <script> $(document).ready(function() { $("#my-menu").mmenu({ setSelected: { // set selected options } }); }); </script>
Give it a go, change the options below and see how it affects the menu in the example on the right.
<script> jQuery(document).ready(function( $ ) { }); </script>
Option | Default value | Datatype | Description |
setSelected | A map of options or true for setSelected.hover and setSelected.parent . |
||
{ | |||
current | true |
Boolean | Whether or not to make the current menu item appear "selected". Set to "detect" if you want the current menu item to be automatically found based on the URL. |
hover | false |
Boolean | Whether or not to make menu item appear "selected" onMouseOver. |
parent | false |
Boolean | Whether or not to make menu item appear "selected" when opening its subpanel. |
} |
The "setSelected" add-on has no configuration options.
The "setSelected" add-on has no API methods.
The "setSelected" add-on has no CSS variables.
Variable | Default value | Datatype | Description |
Include CSS | |||
$mm_opt_setselected | true |
Boolean | Whether or not to include CSS for the setSelected add-on throughout the entire CSS framework. |
Next add-on:
Sidebar