Simple Domodal
Simple modal using Domodule
Installation
npm install simple-domodal
Usage
JavaScript
;// or;
HTML
... This aria-controls will open the modal ×
Events
Custom events are fired on open/close and you can fire an event to open the modal.
Event | Where | When |
---|---|---|
modal:reveal |
If fired on the modal, the modal will open. | |
modal:opened |
On the modal. | On modal open. |
modal:closed |
On the modal. | On modal close. |
Options
Option | Default | Action |
---|---|---|
autoOpen |
false |
If true the modal will open on pageload. |
closable |
true |
If true modal won't disappear on close. |
focus |
Modal Element | Element that will gain focus once the modal is opened. |