Popups: Modal Window
Method modal()
shows new modal window.
Syntax
AWN.modal(message[,className,options])
Parameters
message
Defines message of the modal window. Can be any valid HTML or text string.
className
- optional
Defines modal window DOM element class name, it will be concatenated with default prefix ‘awn-popup-‘
options
- optional
Instance of Options, which will override globals for this call
Return value
A new HTMLElement instance
Behaviour
Modal window can be closed by clicking on darkened wrapper area.
Also you can use Esc
key to close it.
Any combination of keys with Tab
won’t work to keep focus trapped.
Examples
Use defaults
new AWN().modal('<b>Custom modal window message</b>')
Use custom class name
new AWN().modal(
'<b>Custom modal window message</b><br>Class name: `awn-popup-modal-tiny`',
'modal-tiny'
)
Override defaults
let options = {
replacements: {
modal: {
'Class name': 'DOM Class'
}
}
};
new AWN().modal(
'<b>Custom modal window message</b><br>Class name: `awn-popup-modal-tiny`',
'modal-tiny',
options
)