hut-menu
intro
A simple HTML menu module that creates interactive dropdown menus. It contains a minimum amount of styling so that you can customize it to your needs. See the example to see it in action.
usage
- Install using npm -
npm install --save hut-modal
- Import styling using rework-npm -
@import "hut-menu";
- Load JS using browserify -
var menu = require('hut-menu');
code
Home Docs Introduction Reference
var menu = ; var el = document m = ; // Open a submenum; // Close the currently open submenum;
reference
menu(element)
Creates a new menu component and attaches the event handlers. It will return a
new Menu
object.
#current
The currently open submenu (the nested ul
element), or null
if no submenu
is open.
#open(submenu)
Opens a submenu. submenu
must be the nested ul
element to open. It will
also close any currently open submenu.
#close()
Closes any currenly open submenu.