mMenu
is a Metronic's custom plugin defined in
src/js/framework/components/general/menu.js
.
The Metronic's Menu components allows to manage both horizontal and vertical multi level menus for both desktop and mobile modes.
mMenu
is a Metronic's custom plugin defined in
src/js/framework/components/general/menu.js
.
The Metronic's Menu components allows to manage both horizontal and vertical multi level menus for both desktop and mobile modes.
The below code shows the basic vertical menu
initialization with
accordion
submenu mode:
var menu = new mMenu('m_ver_menu', {
// submenu setup
submenu: {
desktop: {
// by default the menu mode set to accordion in desktop mode
default: 'accordion,
// whenever body has this class switch the menu mode to dropdown
state: {
body: 'm-aside-left--minimize',
mode: 'dropdown'
}
},
tablet: 'accordion', // menu set to accordion in tablet mode
mobile: 'accordion' // menu set to accordion in mobile mode
},
//accordion setup
accordion: {
autoScroll: true,
expandAll: false
}
});
The below code shows the basic vertical menu
initialization with
hoverable dropdown
submenu mode:
var menu = new mMenu('m_ver_menu', {
// submenu setup
submenu: {
desktop: {
// by default the menu mode set to accordion in desktop mode
default: 'dropdown',
// whenever body has this class switch the menu mode to dropdown
state: {
body: 'm-aside-left--minimize',
mode: 'dropdown'
}
},
tablet: 'accordion', // menu set to accordion in tablet mode
mobile: 'accordion' // menu set to accordion in mobile mode
},
//accordion setup
accordion: {
autoScroll: true,
expandAll: false
}
});
The below code shows the basic horizontal menu
initialization:
var menu = new mMenu('m_header_menu', {
submenu: {
desktop: 'dropdown',
tablet: 'accordion',
mobile: 'accordion'
},
accordion: {
slideSpeed: 200, // accordion toggle slide speed in milliseconds
autoScroll: true, // enable auto scrolling(focus) to the clicked menu item
expandAll: false // allow having multiple expanded accordions in the menu
}
});
Field | Type | Description | ||
---|---|---|---|---|
autoscroll.speed |
number |
Autoscroll on accordion submenu tag
|
||
accordion.slideSpeed |
number |
Accordion toggle slide speed in milliseconds
|
||
accordion.autoScroll |
boolean |
Enable auto scrolling(focus) to the clicked menu item
|
||
accordion.autoScrollSpeed |
number |
Enable auto scrolling(focus) to the clicked menu item
|
||
accordion.expandAll |
boolean |
Allow having multiple expanded accordions in the menu
|
||
dropdown.timeout |
number |
Timeout in milliseconds to show and hide the hoverable submenu dropdown
|
||
submenu.desktop |
object|string |
Submenu setup for desktop. Set default for the menu mode in desktop mode.
Whenever any element in HTML has
In the sample below scenario. By default the menu mode set to accordion in desktop mode. Whenever body tag has this class switch the menu mode to dropdown
|
Method | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
setDefaults(options) |
Set default options
|
||||||||||||
setActiveItem(item) |
Set active menu item
|
||||||||||||
getBreadcrumbs(item) |
Get breadcrumb for menu item
|
||||||||||||
getPageTitle(item) |
Get page title for menu item
|
||||||||||||
hideDropdown(item) |
Hide dropdown submenu item
|
||||||||||||
pauseDropdownHover(item) |
Disable menu for given time
|
||||||||||||
resumeDropdownHover(item) |
Enable menu item back after being paused
|
||||||||||||
getSubmenuMode() |
Get submenu mode |
||||||||||||
reload() |
Reload the menu |
||||||||||||
on(name, handler) |
Register event
|
||||||||||||
one(name, handler) |
Register event to be run once
|
I run a team of 20 product managers, developers, QA and UX resources. Previously we designed everything ourselves. For our newest platform we tried out Metronic. I cannot overestimate the impact Metronic has had. It's accelerated development 3x and reduced QA issues by 50%. If you add up the reduced need for design time/resources, the increase in dev speed and the reduction in QA, it's probably saved us $100,000 on this project alone, and I plan to use it for all platforms moving forward.
The flexibility of the design has also allowed us to put out a better looking & working platform and reduced my headaches by 90%. Thank you KeenThemes!
Everything within Metronic is customizable globally to provide limitless unique styled projects
Choose a perfect design for your next project among hundreds of demos
A huge collection of components to power your application with the latest UI/UX trands
Enterprise ready Angular 6 integration with built-in authentication module and many more
Metronic deeply customizes Bootstrap with native look and feel
Our super sleek and intuitive Datatable comes packed with all advanced CRUD features
Metronic is the only theme trusted by over 60,000 developers world wide
Lifetime updates with new demos and features is guaranteed
Metronic is writer with a code structure that all developers will be able to pick up easily and fall in love