jQuery: The Write Less, Do More JavaScript Library

UI/Dialog/dialog

From jQuery JavaScript Library

Jump to: navigation, search

« Back to UI/Dialog

dialog( options )

Make the selected elements Dialog boxes.
Arguments:
optionsOptions
A set of key/value pairs that configure the dialog. All options are optional.


Options:

NameType
autoOpenBoolean
When autoOpen is true the dialog will open automatically when dialog is called. If false it will stay hidden until .dialog("open") is called on it. Default value: true.
buttonsObject
Specifies which buttons should be displayed on the dialog. The property key is the text of the button. The value is the callback function for when the button is clicked. The context of the callback is the dialog element; if you need access to the button, it is available as the target of the event object.
closeFunction
Callback for the dialogclose event. The function gets passed two arguments in accordance with the triggerHandler interface. The data passed is the closed dialog options object.
draggableBoolean
When draggable is true the resulting dialog will be draggable. If false the dialog will not be draggable. Default value: true.
heightNumber
The height of the dialog, in pixels. Default value: 200.
maxHeightNumber
The maximum height to which the dialog can be resized, in pixels. Default value: none.
maxWidthNumber
The maximum width to which the dialog can be resized, in pixels. Default value: none.
minHeightNumber
The minimum height to which the dialog can be resized, in pixels. Default value: none.
minWidthNumber
The minimum width to which the dialog can be resized, in pixels. Default value: none.
modalBoolean
When modal is set to true the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements. Custom style values for the overlay (e.g. changing its color or opacity) can be provided with the overlay option. Default value: false.
overlayOptions
Key/value object of style properties for the overlay to display behind the dialog (but above other page elements). See CSS for details. Default value: none.
positionString, Array
Specifies where the dialog should be displayed. Possible values: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport). Default value: 'center'.
resizableBoolean
Specifies whether the dialog will be resizeable. Possible values: true, false. Default value: true.
titleString
Specifies the title of the dialog. The title can also be specified by the title attribute on the dialog source element.
widthNumber
The width of the dialog, in pixels. Default value: 300.


dialog( "open" )

Opens the specified dialog boxes.
Arguments:
"open"String

dialog( "close" )

Closes the specified dialog boxes.
Arguments:
"close"String

dialog( "destroy" )

Completely remove the dialog.
This method removes the dialog completely.
Arguments:
"destroy"String