1.0.2 • Published 9 years ago
modal-layout v1.0.2
Modal Layout
Modal your way
Install
Via NPM
npm i modal-layout --save
Via Bower
bower install modal-layout --save
Usage
var m = new ModalLayout('Awesome stuff!');
m.on('open', function(modalInstance) {
console.log('modal is open', modalInstance);
});
m.open()
Api
ModalLayout(content [, opts])
Parameters
content
HTMLElement
or string
.
opts
Options | Default | Description |
---|---|---|
esc | true | close modal pressing esc |
beforeOpen | null | call a method before open modal |
prefix | 'modalLayout' | prefix used in your css |
escape | false | escape content html |
Methods
Methods | Description |
---|---|
open | show modal |
close | hide modal |
destroy | destroy modal |
isOpen | check if modal is opened |
Events
Events |
---|
open |
close |
destroy |
License
MIT © Thiago Lagden