Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemzqm/dropdown-menu
A simple dropdown menu component
https://github.com/chemzqm/dropdown-menu
Last synced: about 1 month ago
JSON representation
A simple dropdown menu component
- Host: GitHub
- URL: https://github.com/chemzqm/dropdown-menu
- Owner: chemzqm
- Created: 2016-03-12T16:52:54.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-22T10:50:59.000Z (almost 7 years ago)
- Last Synced: 2024-05-27T12:40:00.242Z (7 months ago)
- Language: JavaScript
- Size: 75.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Dropdown-menu
A simple dropdown-menu component.
## Install
npm i dropdown-menu
_Copy the css file as needed_
## Example
``` html
`````` js
var dropdown = require('dropdown-menu')
var el = document.getElementById('link')
var d = dropdown(el)
d.on('select', function (li) {
console.log(li)
})
```## API
### dropdown(trigger, [postion], [offset])
* trigger is trigger element.
* postion is position string used for [align](https://github.com/chemzqm/align)
* offst is offset argument for [align](https://github.com/chemzqm/align)### .hide()
hide menu element.
## Event
* `select`