mmenu.js Documentation
repository·master·Indexed 25 days ago
https://github.com/frdh/mmenu-jsA JavaScript plugin for creating app-like on-canvas and off-canvas navigation menus with sliding submenus for websites and web applications. Version 9.3.0 requires ES6 compliant browsers. Features include a customizable navbar addon, multi-language support for the On-canvas core module, and various functional add-ons available via the Mmenu.addons object.
What's inside mmenu-js
- mmenu.js is a JavaScript plugin designed to create app-like on- and off-canvas menus for websites and web applications. It features sliding submenus and is highly customizable via various options, extensions, and add-ons.
Licensing for mmenu.js
masterThe mmenu.js plugin is licensed under the CC-BY-NC-4.0 license (Creative Commons Attribution-NonCommercial 4.0 International).
Note: If you intend to use mmenu.js in a commercial project, you must purchase a license from the official website.
Configure Navbar addon options
masterWhen configuring the
navbarsaddon in mmenu.js, you can provide a configuration object to control the navbar's behavior. The addon supports shorthand extensions for thecontentanduseproperties:content: An array of strings defining which elements to show in the navbar. The default value is['prev', 'title']. If a single string is provided instead of an array, it will be automatically converted into an array containing that string.use: A boolean indicating whether the navbar should be used. The default value istrue.
If you pass
trueas the options object, it will be treated as an empty object with default values applied.Browser support for mmenu.js
masterAs of version 9, mmenu.js requires ECMAScript 6 (ES6) compliant browsers.
If you need to support Internet Explorer 11, you should use the latest version of mmenu.js v8 and provide the necessary polyfills.
Initialize mmenu.js
mastermmenu.js is available as a default export for module environments or as a globalMmenuobject in the browser window. It provides a menu system with various core features and optional add-ons.Register On-canvas core translations
masterThe On-canvas core module includes built-in support for several languages. To ensure these translations are available, the default export function must be called, which uses the internaladdutility to register language packs for German (de), Persian (fa), Dutch (nl), Brazilian Portuguese (pt_br), Russian (ru), Slovak (sk), and Ukrainian (uk).Available mmenu.js add-ons
mastermmenu.js includes several core add-ons and optional feature add-ons. These are attached to the
Mmenu.addonsobject. Core add-ons likeoffcanvas,scrollBugFix, andthemeare typically included in the main distribution, while others provide specific UI enhancements.Mmenu.addons = { // Core add-ons offcanvas, scrollBugFix, theme, // Add-ons backButton, counters, iconbar, iconPanels, navbars, pageScroll, searchfield, sectionIndexer, setSelected, sidebar };