Metronic

下一代应用程序的终极Bootstrap和Angular 6管理主题框架,一次购买永久包更新,当前版本5.5.5。

Menu

Overview

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.

Initialization

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
    }
});

Options

Field Type Description
autoscroll.speed number

Autoscroll on accordion submenu tag

Sample
autoscroll: {
    speed: 1200
},
accordion.slideSpeed number

Accordion toggle slide speed in milliseconds

Sample
accordion: {
    slideSpeed: 200
},
accordion.autoScroll boolean

Enable auto scrolling(focus) to the clicked menu item

Sample
accordion: {
    autoScroll: true
},
accordion.autoScrollSpeed number

Enable auto scrolling(focus) to the clicked menu item

Sample
accordion: {
    autoScrollSpeed: 1200
},
accordion.expandAll boolean

Allow having multiple expanded accordions in the menu

Sample
accordion: {
    expandAll: true
},
dropdown.timeout number

Timeout in milliseconds to show and hide the hoverable submenu dropdown

Sample
dropdown: {
    timeout: 500
},
submenu.desktop object|string

Submenu setup for desktop. Set default for the menu mode in desktop mode. Whenever any element in HTML has desktop.state.body class switch the menu mode to desktop.state.mode

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

Sample
submenu: {
    desktop: {
        default: 'accordion',
        state: {
            body: 'm-aside-left--minimize',
            mode: 'dropdown'
        }
    },
},

API Methods

Method Description
setDefaults(options)

Set default options

Input Parameters
Name Type Description
options object

A new options object for the menu

setActiveItem(item)

Set active menu item

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

getBreadcrumbs(item)

Get breadcrumb for menu item

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

getPageTitle(item)

Get page title for menu item

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

hideDropdown(item)

Hide dropdown submenu item

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

pauseDropdownHover(item)

Disable menu for given time

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

resumeDropdownHover(item)

Enable menu item back after being paused

Input Parameters
Name Type Description
item HTML object

Menu item HTML element object

getSubmenuMode()

Get submenu mode

reload()

Reload the menu

on(name, handler)

Register event

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event

one(name, handler)

Register event to be run once

Input Parameters
Name Type Description
name string

Unique event name

handler function

Callback function handler for the event

我运营着一个由20个产品经理,开发人员,QA和UX资源组成的团队。以前我们自己设计了一切。对于我们最新的平台,我们试用了Metronic。我无法高估Metronic的影响力。它加速了3倍的开发,并将质量保证问题减少了50%。如果你减少了对设计时间/资源的需求,开发速度的提高和质量保证的减少,那么这个项目可能只为我们节省了10万美元,我计划将它用于所有平台。
设计的灵活性也使我们能够提供更好的外观和工作平台,并使我的头痛减少90%。谢谢KeenThemes! Jonathan Bartlett, Metronic 客户

强大的框架

Metronic的所有产品都可在全球范围内定制,以提供无限的独特风格项目

多演示

为数百个演示中的下一个项目选择一个完美的设计

无限组件

利用最新的UI / UX交易为您的应用程序提供大量组件的大量组件

Angular 6支持

企业级Angular 6集成了内置的身份验证模块等等

Bootstrap 4

Metronic深度定制Bootstrap,具有原生外观

独家数据库插件

我们超级时尚和直观的Datatable包含所有先进的CRUD功能

60,000+强

Metronic是全球60,000多名开发商信赖的唯一主题

持续更新

使用新演示和功能的终身更新得到保证

质量准则

Metronic是一个具有代码结构的作家,所有开发人员都可以轻松拿起并坠入爱河

全球超过60,000名开发人员信赖的Ultimate Bootstrap Admin主题