accessiblenav.js
v1.0.5
Published
A tiny JavaScript plugin for accessible multi-level dropdown menus
Downloads
98
Readme
accessibleNav.js
A tiny JavaScript plugin for accessible multi-level dropdown menus
Usage
Install
Available as NPM package:
$ yarn add accessiblenav.js
Include
Webpack environment
import accessibleNav from 'accessiblenav.js'
Old-school way
<script src="dist/index.min.js"></script>
Initiate
const nav = document.querySelector('.nav')
accessibleNav(nav, {
selSub: 'ul',
selItem: 'li',
selButton: 'a',
classItemActive: '--active',
classEnabled: '--jsfied',
click: true,
mouseover: true,
keypress: true,
outsideClick: true,
escPress: true,
})
Development
$ yarn
$ yarn dev
- Edit plugin at
/src/index.js
, edit demo(s) at/demo
- Build with
$ yarn build
when done