Options Events Methods Theming: UI/Dialog
Options Events Methods Theming: UI/Dialog
8/Dialog
(Redirected from UI/Dialog)
• Overview
• Options
• Events
• Methods
• Theming
OVERVIEW
A dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and
closed with the 'x' icon by default.
If the content length exceeds the maximum height, a scrollbar will automatically appear.
A bottom button bar and semi-transparent modal overlay layer are common options that can be added.
A call to $(foo).dialog() will initialize a dialog instance and will auto-open the dialog by default. If you want
to reuse a dialog, the easiest way is to disable the "auto-open" option with:$(foo).dialog({ autoOpen:
false }) and open it with $(foo).dialog('open'). To close it, use $(foo).dialog('close'). A more in-depth
explanation with a full demo is available on the Nemikor blog.
Dependencies
• UI Core
• UI Draggable (Optional)
• UI Resizable (Optional)
Example
• Demo
• View Source
A simple jQuery UI Dialog.
$("#dialog").dialog();
Object 1
Options
Events
Methods
• destroy
Signature:
.dialog( "destroy" )
Remove the dialog functionality completely. This will return the element back to its pre-init state.
• disable
Signature:
.dialog( "disable" )
Disable the dialog.
• enable
Signature:
.dialog( "enable" )
Enable the dialog.
• option
Signature:
.dialog( "option" , optionName , [value] )
Get or set any dialog option. If no value is specified, will act as a getter.
• option
Signature:
.dialog( "option" , options )
Set multiple dialog options at once by providing an options object.
• widget
Signature:
.dialog( "widget" )
Returns the .ui-dialog element.
• close
Signature:
.dialog( "close" )
Close the dialog.
• isOpen
Signature:
.dialog( "isOpen" )
Returns true if the dialog is currently open.
• moveToTop
Signature:
.dialog( "moveToTop" )
Move the dialog to the top of the dialogs stack.
• open
Signature:
.dialog( "open" )
Open the dialog.
Theming
The jQuery UI Dialog plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and
background textures. We recommend using the ThemeRoller tool to create and download custom themes that
are easy to build and maintain.
If a deeper level of customization is needed, there are widget-specific classes referenced within the
jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.