Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`