To enable creating a menu from a Bootstrap navbar collapse,
include the "bootstrap3" or "bootstrap4" wrapper .js file and add "bootstrap3"
or "bootstrap4"
to the wrappers
option.
<head> <script src="path/to/jquery.js"></script> <script src="path/to/jquery.mmenu.js"></script> <script src="path/to/jquery.mmenu.bootstrap4.js"></script> <script> $(document).ready(function() { $(".navbar-collapse").mmenu({ wrappers: ["bootstrap4"] }); }); </script>
Using the "bootstrap" wrapper will refactor the HTML for a Bootstrap navbar collapse to work with mmenu.
It can refactor lists (.navbar-nav
), text, dropdowns (.dropdown-menu
and forms (.form-inline
).
It also sets the classNames.selected
configuration option to the default classname used by Bootstrap.
Give it a go, hit the orientation-icon to toggle the Bootstrap navbar.
Next wrapper:
jQuery Mobile