The mmenu-light is a lite version of the menu plugin that makes it easy to create a hamburger move out of the canvas just like the original mobile app.
It’s easy to implement a very clean and easy-to-use mobile navigation system into your web application in just a minute.
[Bootstrap 5] Responsive Navbar With off-canvas Display on Mobile
How to make use of it:
Import the stylesheet mmenu-light.css
and JavaScript mmenu-light.js
into the HTML.
<link rel="stylesheet" href="./dist/mmenu-light.css" /> <script src="./dist/mmenu-light.js"></script>
Create an anchor link for the hamburger toggle button.
<a href="#menu"><span></span></a>
Create a multi-level off-canvas menu from nested HTML lists.
<nav id="menu"> <ul> <li class="Selected"><a href="#">Home</a></li> <li><span>About us</span> <ul> <li><a href="#about/history">History</a></li> <li><span>The team</span> <ul> <li><a href="#about/team/management">Management</a></li> <li><a href="#about/team/sales">Sales</a></li> <li><a href="#about/team/development">Development</a></li> </ul> </li> <li><a href="#about/address">Our address</a></li> </ul> </li> <li><a href="#contact">Contact</a></li> </ul> </nav>
Initialize the off-canvas navigation. Possible choices:
const menu = new MmenuLight( document.querySelector( '#menu' ), 'all');
Create a set navigation bar. Possible choices:
var navigator = menu.navigation({ // selectedClass: 'Selected', // slidingSubmenus: true, // theme: 'dark', // title: 'Menu' });
Activate the off-canvas navigation. Possible choices:
var drawer = menu.offcanvas({ // position: 'left' });
Enable the hamburger button to toggle the off-canvas navigation.
document.querySelector( 'a[href="#menu"]' ) .addEventListener( 'click', evnt => { evnt.preventDefault(); drawer.open(); });
Open a panel within the navigation.
navigator.openPanel( menu.querySelector( "ul" ); );
Open/shut the navigation.
drawer.open(); drawer.close();
Lightweight Mobile App Navigation System, mmenu light Plugin/Github
See Demo And Download
Official Website(FrDH): Click Here
This superior jQuery/javascript plugin is developed by FrDH. For extra Advanced Usages, please go to the official website.