mmenu.js Documentation

repository·master·Indexed 25 days ago

https://github.com/frdh/mmenu-js

A 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.

Tokens
678
Snippets
1
Records
7
Agent score
82%

What's inside mmenu-js

  1. Overview of mmenu.js

    master
    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.
  2. Licensing for mmenu.js

    master

    The 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.

  3. Configure Navbar addon options

    master

    When configuring the navbars addon in mmenu.js, you can provide a configuration object to control the navbar's behavior. The addon supports shorthand extensions for the content and use properties:

    • 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 is true.

    If you pass true as the options object, it will be treated as an empty object with default values applied.

  4. Browser support for mmenu.js

    master

    As 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.

  5. Register On-canvas core translations

    master
    The 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 internal add utility to register language packs for German (de), Persian (fa), Dutch (nl), Brazilian Portuguese (pt_br), Russian (ru), Slovak (sk), and Ukrainian (uk).
  6. Available mmenu.js add-ons

    master

    mmenu.js includes several core add-ons and optional feature add-ons. These are attached to the Mmenu.addons object. Core add-ons like offcanvas, scrollBugFix, and theme are 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
    };