JAVASCRIPT
Dropdown menus
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Method name | Description |
---|---|
new Dropdown(trigger, options) | Constructor |
.dismiss([callHandler]) | Closes the dropdown. |
.open([callHandler]) | Opens the dropdown |
trigger
Trigger Elementoptions
Options Objectoptions.target
Target of the dropdown action. By default, dropdown will try to find an element with the `.dropdown-menu` class.options.hoverOpen
The number of seconds you need to hover with the mouse before the dropdown opens.options.dismissOnInsideClick
falseWhether to dismiss the dropdown when there's a click inside.options.dismissOnOutsideClick
trueWhether to dismiss the dropdown when there's a click outside.options.dismissAfter
When the mouse moves away from the dropdown, wait for `dismissAfter` seconds and only then dismiss.options.onInsideClick
Called when there's a click inside the dropdown.options.onOutsideClick
Called when there's a click outside the dropdown.options.onOpen
Called when the dropdown is opened.options.onDismiss
Called when the dropdown is dismissed.Demo
Code
To get an hidden default state for the dropdown menu, just add the hide-all
class to the dropdown-menu
aswell.
Closes the dropdown.
callHandler
falseWhether to call the onDismiss handlerOpens the dropdown
callHandler
falsecall onOpen handler