2
<ul class="UIAPIPlugin-toc">
3
<li><a href="#overview">Overview</a></li>
4
<li><a href="#options">Options</a></li>
5
<li><a href="#events">Events</a></li>
6
<li><a href="#methods">Methods</a></li>
7
<li><a href="#theming">Theming</a></li>
9
<div class="UIAPIPlugin">
10
<h1>jQuery UI Dialog</h1>
12
<h2 class="top-header">Overview</h2>
13
<div id="overview-main">
14
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.
15
</p><p>If the content length exceeds the maximum height, a scrollbar will automatically appear.
17
A bottom button bar and semi-transparent modal overlay layer are common options that can be added.
19
<div id="overview-dependencies">
23
<li>UI Draggable (Optional)</li>
24
<li>UI Resizable (Optional)</li>
27
<div id="overview-example">
29
<div id="overview-example" class="example">
30
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
31
<p><div id="demo" class="tabs-container" rel="300">
32
A simple jQuery UI Dialog.<br />
34
<pre>$("#dialog").dialog();
36
<p></div><div id="source" class="tabs-container">
38
<pre><!DOCTYPE html>
41
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
42
<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
43
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
44
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.draggable.js"></script>
45
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.resizable.js"></script>
46
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.dialog.js"></script>
47
<script type="text/javascript">
48
$(document).ready(function(){
49
$("#dialog").dialog();
53
<body style="font-size:62.5%;">
55
<div id="dialog" title="Dialog Title">I'm in a dialog</div>
65
<h2 class="top-header">Options</h2>
66
<ul class="options-list">
68
<li class="option" id="option-autoOpen">
69
<div class="option-header">
70
<h3 class="option-name"><a href="#option-autoOpen">autoOpen</a></h3>
72
<dt class="option-type-label">Type:</dt>
73
<dd class="option-type">Boolean</dd>
75
<dt class="option-default-label">Default:</dt>
76
<dd class="option-default">true</dd>
80
<div class="option-description">
81
<p>When <i>autoOpen</i> is <i>true</i> the dialog will open automatically when <i>dialog</i> is called. If <i>false</i> it will stay hidden until <i>.dialog("open")</i> is called on it.</p>
83
<div class="option-examples">
84
<h4>Code examples</h4>
85
<dl class="option-examples-list">
88
Initialize a dialog with the <code>autoOpen</code> option specified.
91
<pre><code>$('.selector').dialog({ autoOpen: false });</code></pre>
96
Get or set the <code>autoOpen</code> option, after init.
100
var autoOpen = $('.selector').dialog('option', 'autoOpen');
102
$('.selector').dialog('option', 'autoOpen', false);</code></pre>
110
<li class="option" id="option-bgiframe">
111
<div class="option-header">
112
<h3 class="option-name"><a href="#option-bgiframe">bgiframe</a></h3>
114
<dt class="option-type-label">Type:</dt>
115
<dd class="option-type">Boolean</dd>
117
<dt class="option-default-label">Default:</dt>
118
<dd class="option-default">false</dd>
122
<div class="option-description">
123
<p>When true, the bgiframe plugin will be used, to fix the issue in IE6 where select boxes show on top of other elements, regardless of zIndex. Requires including the bgiframe plugin. Future versions may not require a separate plugin.</p>
125
<div class="option-examples">
126
<h4>Code examples</h4>
127
<dl class="option-examples-list">
130
Initialize a dialog with the <code>bgiframe</code> option specified.
133
<pre><code>$('.selector').dialog({ bgiframe: true });</code></pre>
138
Get or set the <code>bgiframe</code> option, after init.
142
var bgiframe = $('.selector').dialog('option', 'bgiframe');
144
$('.selector').dialog('option', 'bgiframe', true);</code></pre>
152
<li class="option" id="option-buttons">
153
<div class="option-header">
154
<h3 class="option-name"><a href="#option-buttons">buttons</a></h3>
156
<dt class="option-type-label">Type:</dt>
157
<dd class="option-type">Object</dd>
159
<dt class="option-default-label">Default:</dt>
160
<dd class="option-default">{ }</dd>
164
<div class="option-description">
165
<p>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.
168
<div class="option-examples">
169
<h4>Code examples</h4>
170
<dl class="option-examples-list">
173
Initialize a dialog with the <code>buttons</code> option specified.
176
<pre><code>$('.selector').dialog({ buttons: { "Ok": function() { $(this).dialog("close"); } } });</code></pre>
181
Get or set the <code>buttons</code> option, after init.
185
var buttons = $('.selector').dialog('option', 'buttons');
187
$('.selector').dialog('option', 'buttons', { "Ok": function() { $(this).dialog("close"); } });</code></pre>
195
<li class="option" id="option-closeOnEscape">
196
<div class="option-header">
197
<h3 class="option-name"><a href="#option-closeOnEscape">closeOnEscape</a></h3>
199
<dt class="option-type-label">Type:</dt>
200
<dd class="option-type">Boolean</dd>
202
<dt class="option-default-label">Default:</dt>
203
<dd class="option-default">true</dd>
207
<div class="option-description">
208
<p>Specifies whether the dialog should close when it has focus and the user presses the esacpe (ESC) key.</p>
210
<div class="option-examples">
211
<h4>Code examples</h4>
212
<dl class="option-examples-list">
215
Initialize a dialog with the <code>closeOnEscape</code> option specified.
218
<pre><code>$('.selector').dialog({ closeOnEscape: false });</code></pre>
223
Get or set the <code>closeOnEscape</code> option, after init.
227
var closeOnEscape = $('.selector').dialog('option', 'closeOnEscape');
229
$('.selector').dialog('option', 'closeOnEscape', false);</code></pre>
237
<li class="option" id="option-dialogClass">
238
<div class="option-header">
239
<h3 class="option-name"><a href="#option-dialogClass">dialogClass</a></h3>
241
<dt class="option-type-label">Type:</dt>
242
<dd class="option-type">String</dd>
244
<dt class="option-default-label">Default:</dt>
245
<dd class="option-default">''</dd>
249
<div class="option-description">
250
<p>The specified class name(s) will be added to the dialog, for additional theming.</p>
252
<div class="option-examples">
253
<h4>Code examples</h4>
254
<dl class="option-examples-list">
257
Initialize a dialog with the <code>dialogClass</code> option specified.
260
<pre><code>$('.selector').dialog({ dialogClass: 'alert' });</code></pre>
265
Get or set the <code>dialogClass</code> option, after init.
269
var dialogClass = $('.selector').dialog('option', 'dialogClass');
271
$('.selector').dialog('option', 'dialogClass', 'alert');</code></pre>
279
<li class="option" id="option-draggable">
280
<div class="option-header">
281
<h3 class="option-name"><a href="#option-draggable">draggable</a></h3>
283
<dt class="option-type-label">Type:</dt>
284
<dd class="option-type">Boolean</dd>
286
<dt class="option-default-label">Default:</dt>
287
<dd class="option-default">true</dd>
291
<div class="option-description">
292
<p>If set to true, the dialog will be draggable will be draggable by the titlebar.</p>
294
<div class="option-examples">
295
<h4>Code examples</h4>
296
<dl class="option-examples-list">
299
Initialize a dialog with the <code>draggable</code> option specified.
302
<pre><code>$('.selector').dialog({ draggable: false });</code></pre>
307
Get or set the <code>draggable</code> option, after init.
311
var draggable = $('.selector').dialog('option', 'draggable');
313
$('.selector').dialog('option', 'draggable', false);</code></pre>
321
<li class="option" id="option-height">
322
<div class="option-header">
323
<h3 class="option-name"><a href="#option-height">height</a></h3>
325
<dt class="option-type-label">Type:</dt>
326
<dd class="option-type">Number</dd>
328
<dt class="option-default-label">Default:</dt>
329
<dd class="option-default">'auto'</dd>
333
<div class="option-description">
334
<p>The height of the dialog, in pixels.</p>
336
<div class="option-examples">
337
<h4>Code examples</h4>
338
<dl class="option-examples-list">
341
Initialize a dialog with the <code>height</code> option specified.
344
<pre><code>$('.selector').dialog({ height: 530 });</code></pre>
349
Get or set the <code>height</code> option, after init.
353
var height = $('.selector').dialog('option', 'height');
355
$('.selector').dialog('option', 'height', 530);</code></pre>
363
<li class="option" id="option-hide">
364
<div class="option-header">
365
<h3 class="option-name"><a href="#option-hide">hide</a></h3>
367
<dt class="option-type-label">Type:</dt>
368
<dd class="option-type">String</dd>
370
<dt class="option-default-label">Default:</dt>
371
<dd class="option-default">null</dd>
375
<div class="option-description">
376
<p>The effect to be used when the dialog is closed.</p>
378
<div class="option-examples">
379
<h4>Code examples</h4>
380
<dl class="option-examples-list">
383
Initialize a dialog with the <code>hide</code> option specified.
386
<pre><code>$('.selector').dialog({ hide: 'slide' });</code></pre>
391
Get or set the <code>hide</code> option, after init.
395
var hide = $('.selector').dialog('option', 'hide');
397
$('.selector').dialog('option', 'hide', 'slide');</code></pre>
405
<li class="option" id="option-maxHeight">
406
<div class="option-header">
407
<h3 class="option-name"><a href="#option-maxHeight">maxHeight</a></h3>
409
<dt class="option-type-label">Type:</dt>
410
<dd class="option-type">Number</dd>
412
<dt class="option-default-label">Default:</dt>
413
<dd class="option-default">false</dd>
417
<div class="option-description">
418
<p>The maximum height to which the dialog can be resized, in pixels.</p>
420
<div class="option-examples">
421
<h4>Code examples</h4>
422
<dl class="option-examples-list">
425
Initialize a dialog with the <code>maxHeight</code> option specified.
428
<pre><code>$('.selector').dialog({ maxHeight: 400 });</code></pre>
433
Get or set the <code>maxHeight</code> option, after init.
437
var maxHeight = $('.selector').dialog('option', 'maxHeight');
439
$('.selector').dialog('option', 'maxHeight', 400);</code></pre>
447
<li class="option" id="option-maxWidth">
448
<div class="option-header">
449
<h3 class="option-name"><a href="#option-maxWidth">maxWidth</a></h3>
451
<dt class="option-type-label">Type:</dt>
452
<dd class="option-type">Number</dd>
454
<dt class="option-default-label">Default:</dt>
455
<dd class="option-default">false</dd>
459
<div class="option-description">
460
<p>The maximum width to which the dialog can be resized, in pixels.</p>
462
<div class="option-examples">
463
<h4>Code examples</h4>
464
<dl class="option-examples-list">
467
Initialize a dialog with the <code>maxWidth</code> option specified.
470
<pre><code>$('.selector').dialog({ maxWidth: 600 });</code></pre>
475
Get or set the <code>maxWidth</code> option, after init.
479
var maxWidth = $('.selector').dialog('option', 'maxWidth');
481
$('.selector').dialog('option', 'maxWidth', 600);</code></pre>
489
<li class="option" id="option-minHeight">
490
<div class="option-header">
491
<h3 class="option-name"><a href="#option-minHeight">minHeight</a></h3>
493
<dt class="option-type-label">Type:</dt>
494
<dd class="option-type">Number</dd>
496
<dt class="option-default-label">Default:</dt>
497
<dd class="option-default">150</dd>
501
<div class="option-description">
502
<p>The minimum height to which the dialog can be resized, in pixels.</p>
504
<div class="option-examples">
505
<h4>Code examples</h4>
506
<dl class="option-examples-list">
509
Initialize a dialog with the <code>minHeight</code> option specified.
512
<pre><code>$('.selector').dialog({ minHeight: 300 });</code></pre>
517
Get or set the <code>minHeight</code> option, after init.
521
var minHeight = $('.selector').dialog('option', 'minHeight');
523
$('.selector').dialog('option', 'minHeight', 300);</code></pre>
531
<li class="option" id="option-minWidth">
532
<div class="option-header">
533
<h3 class="option-name"><a href="#option-minWidth">minWidth</a></h3>
535
<dt class="option-type-label">Type:</dt>
536
<dd class="option-type">Number</dd>
538
<dt class="option-default-label">Default:</dt>
539
<dd class="option-default">150</dd>
543
<div class="option-description">
544
<p>The minimum width to which the dialog can be resized, in pixels.</p>
546
<div class="option-examples">
547
<h4>Code examples</h4>
548
<dl class="option-examples-list">
551
Initialize a dialog with the <code>minWidth</code> option specified.
554
<pre><code>$('.selector').dialog({ minWidth: 400 });</code></pre>
559
Get or set the <code>minWidth</code> option, after init.
563
var minWidth = $('.selector').dialog('option', 'minWidth');
565
$('.selector').dialog('option', 'minWidth', 400);</code></pre>
573
<li class="option" id="option-modal">
574
<div class="option-header">
575
<h3 class="option-name"><a href="#option-modal">modal</a></h3>
577
<dt class="option-type-label">Type:</dt>
578
<dd class="option-type">Boolean</dd>
580
<dt class="option-default-label">Default:</dt>
581
<dd class="option-default">false</dd>
585
<div class="option-description">
586
<p>If 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.</p>
588
<div class="option-examples">
589
<h4>Code examples</h4>
590
<dl class="option-examples-list">
593
Initialize a dialog with the <code>modal</code> option specified.
596
<pre><code>$('.selector').dialog({ modal: true });</code></pre>
601
Get or set the <code>modal</code> option, after init.
605
var modal = $('.selector').dialog('option', 'modal');
607
$('.selector').dialog('option', 'modal', true);</code></pre>
615
<li class="option" id="option-position">
616
<div class="option-header">
617
<h3 class="option-name"><a href="#option-position">position</a></h3>
619
<dt class="option-type-label">Type:</dt>
620
<dd class="option-type">String, Array</dd>
622
<dt class="option-default-label">Default:</dt>
623
<dd class="option-default">'center'</dd>
627
<div class="option-description">
628
<p>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) or the possible string values (e.g. ['right','top'] for top right corner).</p>
630
<div class="option-examples">
631
<h4>Code examples</h4>
632
<dl class="option-examples-list">
635
Initialize a dialog with the <code>position</code> option specified.
638
<pre><code>$('.selector').dialog({ position: 'top' });</code></pre>
643
Get or set the <code>position</code> option, after init.
647
var position = $('.selector').dialog('option', 'position');
649
$('.selector').dialog('option', 'position', 'top');</code></pre>
657
<li class="option" id="option-resizable">
658
<div class="option-header">
659
<h3 class="option-name"><a href="#option-resizable">resizable</a></h3>
661
<dt class="option-type-label">Type:</dt>
662
<dd class="option-type">Boolean</dd>
664
<dt class="option-default-label">Default:</dt>
665
<dd class="option-default">true</dd>
669
<div class="option-description">
670
<p>If set to true, the dialog will be resizeable.</p>
672
<div class="option-examples">
673
<h4>Code examples</h4>
674
<dl class="option-examples-list">
677
Initialize a dialog with the <code>resizable</code> option specified.
680
<pre><code>$('.selector').dialog({ resizable: false });</code></pre>
685
Get or set the <code>resizable</code> option, after init.
689
var resizable = $('.selector').dialog('option', 'resizable');
691
$('.selector').dialog('option', 'resizable', false);</code></pre>
699
<li class="option" id="option-show">
700
<div class="option-header">
701
<h3 class="option-name"><a href="#option-show">show</a></h3>
703
<dt class="option-type-label">Type:</dt>
704
<dd class="option-type">String</dd>
706
<dt class="option-default-label">Default:</dt>
707
<dd class="option-default">null</dd>
711
<div class="option-description">
712
<p>The effect to be used when the dialog is opened.</p>
714
<div class="option-examples">
715
<h4>Code examples</h4>
716
<dl class="option-examples-list">
719
Initialize a dialog with the <code>show</code> option specified.
722
<pre><code>$('.selector').dialog({ show: 'slide' });</code></pre>
727
Get or set the <code>show</code> option, after init.
731
var show = $('.selector').dialog('option', 'show');
733
$('.selector').dialog('option', 'show', 'slide');</code></pre>
741
<li class="option" id="option-stack">
742
<div class="option-header">
743
<h3 class="option-name"><a href="#option-stack">stack</a></h3>
745
<dt class="option-type-label">Type:</dt>
746
<dd class="option-type">Boolean</dd>
748
<dt class="option-default-label">Default:</dt>
749
<dd class="option-default">true</dd>
753
<div class="option-description">
754
<p>Specifies whether the dialog will stack on top of other dialogs. This will cause the dialog to move to the front of other dialogs when it gains focus.</p>
756
<div class="option-examples">
757
<h4>Code examples</h4>
758
<dl class="option-examples-list">
761
Initialize a dialog with the <code>stack</code> option specified.
764
<pre><code>$('.selector').dialog({ stack: false });</code></pre>
769
Get or set the <code>stack</code> option, after init.
773
var stack = $('.selector').dialog('option', 'stack');
775
$('.selector').dialog('option', 'stack', false);</code></pre>
783
<li class="option" id="option-title">
784
<div class="option-header">
785
<h3 class="option-name"><a href="#option-title">title</a></h3>
787
<dt class="option-type-label">Type:</dt>
788
<dd class="option-type">String</dd>
790
<dt class="option-default-label">Default:</dt>
791
<dd class="option-default">''</dd>
795
<div class="option-description">
796
<p>Specifies the title of the dialog. The title can also be specified by the title attribute on the dialog source element.</p>
798
<div class="option-examples">
799
<h4>Code examples</h4>
800
<dl class="option-examples-list">
803
Initialize a dialog with the <code>title</code> option specified.
806
<pre><code>$('.selector').dialog({ title: 'Dialog Title' });</code></pre>
811
Get or set the <code>title</code> option, after init.
815
var title = $('.selector').dialog('option', 'title');
817
$('.selector').dialog('option', 'title', 'Dialog Title');</code></pre>
825
<li class="option" id="option-width">
826
<div class="option-header">
827
<h3 class="option-name"><a href="#option-width">width</a></h3>
829
<dt class="option-type-label">Type:</dt>
830
<dd class="option-type">Number</dd>
832
<dt class="option-default-label">Default:</dt>
833
<dd class="option-default">300</dd>
837
<div class="option-description">
838
<p>The width of the dialog, in pixels.</p>
840
<div class="option-examples">
841
<h4>Code examples</h4>
842
<dl class="option-examples-list">
845
Initialize a dialog with the <code>width</code> option specified.
848
<pre><code>$('.selector').dialog({ width: 460 });</code></pre>
853
Get or set the <code>width</code> option, after init.
857
var width = $('.selector').dialog('option', 'width');
859
$('.selector').dialog('option', 'width', 460);</code></pre>
867
<li class="option" id="option-zIndex">
868
<div class="option-header">
869
<h3 class="option-name"><a href="#option-zIndex">zIndex</a></h3>
871
<dt class="option-type-label">Type:</dt>
872
<dd class="option-type">Integer</dd>
874
<dt class="option-default-label">Default:</dt>
875
<dd class="option-default">1000</dd>
879
<div class="option-description">
880
<p>The starting z-index for the dialog.</p>
882
<div class="option-examples">
883
<h4>Code examples</h4>
884
<dl class="option-examples-list">
887
Initialize a dialog with the <code>zIndex</code> option specified.
890
<pre><code>$('.selector').dialog({ zIndex: 3999 });</code></pre>
895
Get or set the <code>zIndex</code> option, after init.
899
var zIndex = $('.selector').dialog('option', 'zIndex');
901
$('.selector').dialog('option', 'zIndex', 3999);</code></pre>
911
<h2 class="top-header">Events</h2>
912
<ul class="events-list">
914
<li class="event" id="event-beforeclose">
915
<div class="event-header">
916
<h3 class="event-name"><a href="#event-beforeclose">beforeclose</a></h3>
918
<dt class="event-type-label">Type:</dt>
919
<dd class="event-type">dialogbeforeclose</dd>
922
<div class="event-description">
923
<p>This event is triggered when a dialog attempts to close. If the beforeclose event handler (callback function) returns false, the close will be prevented.</p>
925
<div class="event-examples">
926
<h4>Code examples</h4>
927
<dl class="event-examples-list">
930
Supply a callback function to handle the <code>beforeclose</code> event as an init option.
933
<pre><code>$('.selector').dialog({
934
beforeclose: function(event, ui) { ... }
940
Bind to the <code>beforeclose</code> event by type: <code>dialogbeforeclose</code>.
943
<pre><code>$('.selector').bind('dialogbeforeclose', function(event, ui) {
953
<li class="event" id="event-open">
954
<div class="event-header">
955
<h3 class="event-name"><a href="#event-open">open</a></h3>
957
<dt class="event-type-label">Type:</dt>
958
<dd class="event-type">dialogopen</dd>
961
<div class="event-description">
962
<p>This event is triggered when dialog is opened.</p>
964
<div class="event-examples">
965
<h4>Code examples</h4>
966
<dl class="event-examples-list">
969
Supply a callback function to handle the <code>open</code> event as an init option.
972
<pre><code>$('.selector').dialog({
973
open: function(event, ui) { ... }
979
Bind to the <code>open</code> event by type: <code>dialogopen</code>.
982
<pre><code>$('.selector').bind('dialogopen', function(event, ui) {
992
<li class="event" id="event-focus">
993
<div class="event-header">
994
<h3 class="event-name"><a href="#event-focus">focus</a></h3>
996
<dt class="event-type-label">Type:</dt>
997
<dd class="event-type">dialogfocus</dd>
1000
<div class="event-description">
1001
<p>This event is triggered when the dialog gains focus.</p>
1003
<div class="event-examples">
1004
<h4>Code examples</h4>
1005
<dl class="event-examples-list">
1008
Supply a callback function to handle the <code>focus</code> event as an init option.
1011
<pre><code>$('.selector').dialog({
1012
focus: function(event, ui) { ... }
1018
Bind to the <code>focus</code> event by type: <code>dialogfocus</code>.
1021
<pre><code>$('.selector').bind('dialogfocus', function(event, ui) {
1031
<li class="event" id="event-dragStart">
1032
<div class="event-header">
1033
<h3 class="event-name"><a href="#event-dragStart">dragStart</a></h3>
1035
<dt class="event-type-label">Type:</dt>
1036
<dd class="event-type">dragStart</dd>
1039
<div class="event-description">
1040
<p>This event is triggered at the beginning of the dialog being dragged.</p>
1042
<div class="event-examples">
1043
<h4>Code examples</h4>
1044
<dl class="event-examples-list">
1047
Supply a callback function to handle the <code>dragStart</code> event as an init option.
1050
<pre><code>$('.selector').dialog({
1051
dragStart: function(event, ui) { ... }
1057
Bind to the <code>dragStart</code> event by type: <code>dragStart</code>.
1060
<pre><code>$('.selector').bind('dragStart', function(event, ui) {
1070
<li class="event" id="event-drag">
1071
<div class="event-header">
1072
<h3 class="event-name"><a href="#event-drag">drag</a></h3>
1074
<dt class="event-type-label">Type:</dt>
1075
<dd class="event-type">drag</dd>
1078
<div class="event-description">
1079
<p>This event is triggered when the dialog is dragged.</p>
1081
<div class="event-examples">
1082
<h4>Code examples</h4>
1083
<dl class="event-examples-list">
1086
Supply a callback function to handle the <code>drag</code> event as an init option.
1089
<pre><code>$('.selector').dialog({
1090
drag: function(event, ui) { ... }
1096
Bind to the <code>drag</code> event by type: <code>drag</code>.
1099
<pre><code>$('.selector').bind('drag', function(event, ui) {
1109
<li class="event" id="event-dragStop">
1110
<div class="event-header">
1111
<h3 class="event-name"><a href="#event-dragStop">dragStop</a></h3>
1113
<dt class="event-type-label">Type:</dt>
1114
<dd class="event-type">dragStop</dd>
1117
<div class="event-description">
1118
<p>This event is triggered after the dialog has been dragged.</p>
1120
<div class="event-examples">
1121
<h4>Code examples</h4>
1122
<dl class="event-examples-list">
1125
Supply a callback function to handle the <code>dragStop</code> event as an init option.
1128
<pre><code>$('.selector').dialog({
1129
dragStop: function(event, ui) { ... }
1135
Bind to the <code>dragStop</code> event by type: <code>dragStop</code>.
1138
<pre><code>$('.selector').bind('dragStop', function(event, ui) {
1148
<li class="event" id="event-resizeStart">
1149
<div class="event-header">
1150
<h3 class="event-name"><a href="#event-resizeStart">resizeStart</a></h3>
1152
<dt class="event-type-label">Type:</dt>
1153
<dd class="event-type">resizeStart</dd>
1156
<div class="event-description">
1157
<p>This event is triggered at the beginning of the dialog being resized.</p>
1159
<div class="event-examples">
1160
<h4>Code examples</h4>
1161
<dl class="event-examples-list">
1164
Supply a callback function to handle the <code>resizeStart</code> event as an init option.
1167
<pre><code>$('.selector').dialog({
1168
resizeStart: function(event, ui) { ... }
1174
Bind to the <code>resizeStart</code> event by type: <code>resizeStart</code>.
1177
<pre><code>$('.selector').bind('resizeStart', function(event, ui) {
1187
<li class="event" id="event-resize">
1188
<div class="event-header">
1189
<h3 class="event-name"><a href="#event-resize">resize</a></h3>
1191
<dt class="event-type-label">Type:</dt>
1192
<dd class="event-type">resize</dd>
1195
<div class="event-description">
1196
<p>This event is triggered when the dialog is resized.</p>
1198
<div class="event-examples">
1199
<h4>Code examples</h4>
1200
<dl class="event-examples-list">
1203
Supply a callback function to handle the <code>resize</code> event as an init option.
1206
<pre><code>$('.selector').dialog({
1207
resize: function(event, ui) { ... }
1213
Bind to the <code>resize</code> event by type: <code>resize</code>.
1216
<pre><code>$('.selector').bind('resize', function(event, ui) {
1226
<li class="event" id="event-resizeStop">
1227
<div class="event-header">
1228
<h3 class="event-name"><a href="#event-resizeStop">resizeStop</a></h3>
1230
<dt class="event-type-label">Type:</dt>
1231
<dd class="event-type">resizeStop</dd>
1234
<div class="event-description">
1235
<p>This event is triggered after the dialog has been resized.</p>
1237
<div class="event-examples">
1238
<h4>Code examples</h4>
1239
<dl class="event-examples-list">
1242
Supply a callback function to handle the <code>resizeStop</code> event as an init option.
1245
<pre><code>$('.selector').dialog({
1246
resizeStop: function(event, ui) { ... }
1252
Bind to the <code>resizeStop</code> event by type: <code>resizeStop</code>.
1255
<pre><code>$('.selector').bind('resizeStop', function(event, ui) {
1265
<li class="event" id="event-close">
1266
<div class="event-header">
1267
<h3 class="event-name"><a href="#event-close">close</a></h3>
1269
<dt class="event-type-label">Type:</dt>
1270
<dd class="event-type">dialogclose</dd>
1273
<div class="event-description">
1274
<p>This event is triggered when the dialog is closed.</p>
1276
<div class="event-examples">
1277
<h4>Code examples</h4>
1278
<dl class="event-examples-list">
1281
Supply a callback function to handle the <code>close</code> event as an init option.
1284
<pre><code>$('.selector').dialog({
1285
close: function(event, ui) { ... }
1291
Bind to the <code>close</code> event by type: <code>dialogclose</code>.
1294
<pre><code>$('.selector').bind('dialogclose', function(event, ui) {
1306
<h2 class="top-header">Methods</h2>
1307
<ul class="methods-list">
1309
<li class="method" id="method-destroy">
1310
<div class="method-header">
1311
<h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
1313
<dt class="method-signature-label">Signature:</dt>
1314
<dd class="method-signature">.dialog( 'destroy'
1325
<div class="method-description">
1326
<p>Remove the dialog functionality completely. This will return the element back to its pre-init state.</p>
1331
<li class="method" id="method-disable">
1332
<div class="method-header">
1333
<h3 class="method-name"><a href="#method-disable">disable</a></h3>
1335
<dt class="method-signature-label">Signature:</dt>
1336
<dd class="method-signature">.dialog( 'disable'
1347
<div class="method-description">
1348
<p>Disable the dialog.</p>
1353
<li class="method" id="method-enable">
1354
<div class="method-header">
1355
<h3 class="method-name"><a href="#method-enable">enable</a></h3>
1357
<dt class="method-signature-label">Signature:</dt>
1358
<dd class="method-signature">.dialog( 'enable'
1369
<div class="method-description">
1370
<p>Enable the dialog.</p>
1375
<li class="method" id="method-option">
1376
<div class="method-header">
1377
<h3 class="method-name"><a href="#method-option">option</a></h3>
1379
<dt class="method-signature-label">Signature:</dt>
1380
<dd class="method-signature">.dialog( 'option'
1384
, <span class="optional">[</span>value<span class="optional">] </span>
1391
<div class="method-description">
1392
<p>Get or set any dialog option. If no value is specified, will act as a getter.</p>
1397
<li class="method" id="method-close">
1398
<div class="method-header">
1399
<h3 class="method-name"><a href="#method-close">close</a></h3>
1401
<dt class="method-signature-label">Signature:</dt>
1402
<dd class="method-signature">.dialog( 'close'
1413
<div class="method-description">
1414
<p>Close the dialog.</p>
1419
<li class="method" id="method-isOpen">
1420
<div class="method-header">
1421
<h3 class="method-name"><a href="#method-isOpen">isOpen</a></h3>
1423
<dt class="method-signature-label">Signature:</dt>
1424
<dd class="method-signature">.dialog( 'isOpen'
1435
<div class="method-description">
1436
<p>Returns true if the dialog is currently open.</p>
1441
<li class="method" id="method-moveToTop">
1442
<div class="method-header">
1443
<h3 class="method-name"><a href="#method-moveToTop">moveToTop</a></h3>
1445
<dt class="method-signature-label">Signature:</dt>
1446
<dd class="method-signature">.dialog( 'moveToTop'
1457
<div class="method-description">
1458
<p>Move the dialog to the top of the dialogs stack.</p>
1463
<li class="method" id="method-open">
1464
<div class="method-header">
1465
<h3 class="method-name"><a href="#method-open">open</a></h3>
1467
<dt class="method-signature-label">Signature:</dt>
1468
<dd class="method-signature">.dialog( 'open'
1479
<div class="method-description">
1480
<p>Open the dialog.</p>
1487
<h2 class="top-header">Theming</h2>
1488
<p>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.
1490
<p>If a deeper level of customization is needed, there are widget-specific classes referenced within the ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.
1493
<h3>Sample markup with jQuery UI CSS Framework classes</h3>
1494
<div class="<strong>ui-dialog</strong> ui-widget ui-widget-content ui-corner-all undefined ui-draggable ui-resizable"><br />
1495
<div class="<strong>ui-dialog-titlebar</strong> ui-widget-header ui-corner-all ui-helper-clearfix"><br />
1496
<span id="<strong>ui-dialog-title-dialog</strong>" class="ui-dialog-title">Dialog title</span><br />
1497
<a class="<strong>ui-dialog-titlebar-close</strong> ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a><br />
1498
</div><br />
1499
<div style="height: 200px; min-height: 109px; width: auto;" class="<strong>ui-dialog-content</strong> ui-widget-content" id="dialog"><br />
1500
<p>Dialog content goes here.</p><br />
1501
</div><br />
1503
<p class="theme-note">
1505
Note: This is a sample of markup generated by the dialog plugin, not markup you should use to create a dialog. The only markup needed for that is <div></div>.
1513
Pre-expand include size: 58797 bytes
1514
Post-expand include size: 99942 bytes
1515
Template argument size: 56593 bytes
1516
Maximum: 2097152 bytes
1519
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3181-1!1!0!!en!2 and timestamp 20090319021842 -->