Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

hut-menu

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hut-menu

HTML UI Toolkit menu

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

hut-menu

Build Status Dependency Status

Selenium Test Status

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

<ul class="hut-tabs" id="menu">
    <li><a href="#home">Home</a></li>
    <li>
        <a href="#">Docs</a>
        <ul id="docs-menu">
            <li><a href="#intro">Introduction</a></li>
            <li><a href="#reference">Reference</a></li>
        </ul>
    </li>
</ul>
var menu = require('hut-menu');

var el = document.querySelector('#menu'),
    m = menu(el);

// Open a submenu
m.open(document.querySelector('#docs-menu'));

// Close the currently open submenu
m.close();

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.

Keywords

html

FAQs

Package last updated on 12 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts