KTMenu
is a Metronic's custom plugin defined in [root]/theme/default/src/theme/framework/components/foundation/menu/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 asideMenu = new KTMenu(id, options);
var asideMenu = new KTMenu('kt_aside_menu', {
// vertical scroll
scroll: {
height: function() {}
},
// 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: 'kt-aside--minimize',
mode: 'dropdown'
}
},
tablet: 'accordion', // menu set to accordion in tablet mode
mobile: 'accordion' // menu set to accordion in mobile mode
},
//accordion setup
accordion: {
expandAll: false // allow having multiple expanded accordions in the menu
}
});
The below code shows the basic horizontal menu
initialization:
var headerMenu = new KTMenu('kt_header_menu', {
submenu: {
desktop: 'dropdown',
tablet: 'accordion',
mobile: 'accordion'
},
accordion: {
slideSpeed: 200, // accordion toggle slide speed in milliseconds
expandAll: false // allow having multiple expanded accordions in the menu
}
});