It's simple dropdown menu
npm install simple-dropdown-menu
JS
import Dropdown from "simple-dropdown-menu";
new Dropdown();
Now you can pass the names of eventlisteners that will show or hide the menu.
new Dropdown({listenerEnter: 'click', listenerLeave: 'mouseout'});
HTML
- Add attribute to button for dropdown - data-dropdown-menu="{THIS_YOURS_ID_BLOCK_FOR_SHOW}"
- And add\change ID block for showing
Simple:
<a data-dropdown-menu="category-dropdown">...</a>
<a data-dropdown-menu="category-dropdown" data-dropdown-menu-listener-enter="{MOUSE_EVENT}">...</a>
<a data-dropdown-menu="category-dropdown" data-dropdown-menu-listener-leave="{MOUSE_EVENT}">...</a>
<div id="category-dropdown">...</div>
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
MIT