Appendix P

Dialog

Dialog Methods
Method Description Return Value
dialog(options) Makes the selected elements into dialog boxes. jQuery
dialog('close') Closes the dialog. jQuery
dialog('destroy') Completely removes the dialog. jQuery
dialog('isOpen') Determines if the dialog is open. Boolean
dialog('moveToTop') Moves the specified dialog on top of the dialogs stack. jQuery
dialog('open') Opens the dialog. jQuery
dialog('option', optionName) Returns the value of the specified option. Mixed
dialog('option', optionName, value) Sets the specified option to the specified value. jQuery
dialog('option') Returns an object of options in key, value pairs. Object
dialog('option', optionObject) Sets the specified options as an object of key, value pairs. jQuery
dialog('widget') Returns a jQuery object containing the dialog. jQuery
Dialog Options
Option Description Type
appendTo What element the dialog should be appended to.Default value: 'body' Selector
autoOpen When set to true, the dialog opens automatically when the dialog is called. If set to false, it stays hidden until dialog('open') is called on it.Default value: true Boolean
buttons Specifies which buttons should display 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.Default value: ...

Get Web Development with jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.