Transforms your menu to an off-canvas mobile menu with 2 lines of javascript, no dependencies or external libraries. Only 1kb JS and 3kb CSS when gzipped.
##Example:
Include scripts and styles:
<script src="path/to/mobilio-menu.js" type="text/javascript"></script>
<link href="path/to/mobilio-menu.css" rel="stylesheet" />
Create menu:
<script>
var elem = document.querySelector('#myList');
mobilioMenu.create(elem, { breakpoint:768 });
</script>
Look at the example index.html for and example of how to use mobilio-menu. This library expects your menu to be an UL-list.
##Options
At what width should we initialize/reset the mobilio menu. Null for always.
Defaults: null
Should the menu slide in from left or right
Defaults: 'left'
Light/Dark theme
Defaults: 'dark'
Whether you should hide the original menu when initializing
Defaults: true
An array containing nodenames of allowed elements. If the original menu contains an element which is not allowed, it will be removed along with all of it's children. Merges the user-specified array with the defaults.
Defaults: ['DIV', 'UL', 'OL', 'LI', 'A', 'SPAN']
Classname of the childmenus. Needed for hierarchical menus with toggle-functionality.
Defaults: '.child-menu'
Whether you want to strip the original classes of the elements in the menu. By default all classes will be stripped so that there is no interfering css.
Defaults: true
Whether you want to strip the original attributes IDs of the elements in the menu. By default all IDs will be stripped so that there is no interfering css.
Defaults: true
##Build
Install grunt using npm then just runt 'grunt' in the project directory.
##Caveats
- Only works on browsers with support for CSS3-transforms (Chrome, Safari, Firefox, IE10+)