Every front-end developer needs their own modal window. jQuery modal is performant, tested, customisable and easy to integrate. Less than 2.5KB minified and 1KB gzipped.
This isn't a copy and paste plugin, it's just an outline. The plugin is instantiated in the usual manner and an instances API can be accessed via element data.
You can also 'namespace' plugin instances so that multiple modals can be attached to the same parent.
The simplest example is to open a modal window instance with basic HTML content:
The API is flexible enough to do any common task such as confirmation boxes, displaying images and external content.
Global options can be specified via the standard jQuery plugin interface.
undefined
.
undefined
.
undefined
.
fixed
positioning for the modal window instead of absolute
.
Default: false
.
true
.
true
.
true
.
auto
for the contents automatic flow width.
Default: 640
.
max-width
relative to the modal windows parent. Set to none
to
set no maximum width. Default: '95%'
.
auto
for the contents automatic flow height.
Default: 480
.
max-height
relative to the modal windows parent. Set to none
to
set no maximum height. Default: '95%'
.
'modal'
.
.update()
method.
Callback A function to call once the window has opened.
.align()
method will be called
if the window is open.
this
will
refer to the modal instance. Callbacks provided as arguments to the public methods above will be
executed in addition to those specified as instance options.