Documentation

API

1. Create a new modal with given content:

$.d_modal(content [, options]);

2. Turn an existing DOM element (element) into a modal:

$element.d_modal([options]);

3. Dismiss a previously created modal:

$modal.trigger("dismiss.d_modal");

content

Any valid html. Will be contained in the modal that is created.

$element

A jQuery object. Will be turned into a modal (the class .d-modal will be added to it).

$modal

A reference to a previously created modal.

options

Special Cases

The following section contains any and all documentation of irregular behaviour or special use cases that require your attention!

Dismissal of Modal

Always dismiss the modal by triggering the dismiss.d_modal event, as such:

$(".d-modal").trigger("dismiss.d_modal");

The normal jQuery calls (hide(), remove(), fadeOut(), slideUp(), etc.) may have erratic behaviour.

Setting text and html content

Calling either text() or html() to set the content of a modal will overwrite control elements used, and may have unforeseen consequences.