~jstys-z/helioviewer.org/timeline

« back to all changes in this revision

Viewing changes to lib/jquery/jquery.ui-1.7.1/development-bundle/docs/tabs.html

  • Committer: V. Keith Hughitt
  • Date: 2009-03-26 19:20:57 UTC
  • Revision ID: hughitt1@kore-20090326192057-u0x8rf8sf5lmmnwh
nightly build 03-26-2009: Using alpha-channel JPEG 2000 dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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>
 
8
</ul>
 
9
<div class="UIAPIPlugin">
 
10
  <h1>jQuery UI Tabs</h1>
 
11
  <div id="overview">
 
12
    <h2 class="top-header">Overview</h2>
 
13
    <div id="overview-main">
 
14
        <p>Tabs are generally used to break content into multiple sections that can be swapped to save space, much like an accordion.</p>
 
15
<p>By default a tab widget will swap between tabbed sections onClick, but the events can be changed to onHover through an option. Tab content can be loaded via Ajax by setting an href on a tab.</p>
 
16
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 
17
<ul>
 
18
<li class="toclevel-1"><a href="#Events"><span class="tocnumber">1</span> <span class="toctext">Events</span></a></li>
 
19
<li class="toclevel-1"><a href="#Ajax_mode"><span class="tocnumber">2</span> <span class="toctext">Ajax mode</span></a>
 
20
<ul>
 
21
<li class="toclevel-2"><a href="#Back_button_and_bookmarking"><span class="tocnumber">2.1</span> <span class="toctext">Back button and bookmarking</span></a></li>
 
22
</ul>
 
23
</li>
 
24
<li class="toclevel-1"><a href="#How_to..."><span class="tocnumber">3</span> <span class="toctext">How to...</span></a>
 
25
<ul>
 
26
<li class="toclevel-2"><a href="#...retrieve_the_index_of_the_currently_selected_tab"><span class="tocnumber">3.1</span> <span class="toctext">...retrieve the index of the currently selected tab</span></a></li>
 
27
<li class="toclevel-2"><a href="#...open_links_in_the_current_tab_instead_of_leaving_the_page"><span class="tocnumber">3.2</span> <span class="toctext">...open links in the current tab instead of leaving the page</span></a></li>
 
28
<li class="toclevel-2"><a href="#...select_a_tab_from_a_text_link_instead_of_clicking_a_tab_itself"><span class="tocnumber">3.3</span> <span class="toctext">...select a tab from a text link instead of clicking a tab itself</span></a></li>
 
29
<li class="toclevel-2"><a href="#...prevent_switching_to_the_tab_on_click_depending_on_form_validation"><span class="tocnumber">3.4</span> <span class="toctext">...prevent switching to the tab on click depending on form validation</span></a></li>
 
30
<li class="toclevel-2"><a href="#...immediately_select_a_just_added_tab"><span class="tocnumber">3.5</span> <span class="toctext">...immediately select a just added tab</span></a></li>
 
31
<li class="toclevel-2"><a href="#...open_a_tab_in_a_new_window_instead"><span class="tocnumber">3.6</span> <span class="toctext">...open a tab in a new window instead</span></a></li>
 
32
<li class="toclevel-2"><a href="#...prevent_a_FOUC_.28Flash_of_Unstyled_Content.29_before_tabs_are_initialized"><span class="tocnumber">3.7</span> <span class="toctext">...prevent a FOUC (Flash of Unstyled Content) before tabs are initialized</span></a></li>
 
33
</ul>
 
34
</li>
 
35
<li class="toclevel-1"><a href="#Why_does..."><span class="tocnumber">4</span> <span class="toctext">Why does...</span></a>
 
36
<ul>
 
37
<li class="toclevel-2"><a href="#...my_slider.2C_Google_Map.2C_sIFR_etc._not_work_when_placed_in_a_hidden_.28inactive.29_tab.3F"><span class="tocnumber">4.1</span> <span class="toctext">...my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?</span></a></li>
 
38
</ul>
 
39
</li>
 
40
</ul>
 
41
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 
42
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=1" title="Template:UIAPIPlugin">edit</a>]</div><a name="Events"></a><h2>Events</h2>
 
43
<p>A series of events fire when interacting with a tabs interface:
 
44
</p>
 
45
<ul><li> tabsselect, tabsload, tabsshow (in that order)
 
46
</li><li> tabsadd, tabsremove
 
47
</li><li> tabsenable, tabsdisable
 
48
</li></ul>
 
49
<p>Event binding example:
 
50
</p>
 
51
<pre>$('#example').bind('tabsselect', function(event, ui) {
 
52
 
 
53
    // Objects available in the function context:
 
54
    ui.tab     // anchor element of the selected (clicked) tab
 
55
    ui.panel   // element, that contains the selected/clicked tab contents
 
56
    ui.index   // zero-based index of the selected (clicked) tab
 
57
 
 
58
});</pre>
 
59
<p>Note that if a handler for the tabsselect event returns false, the clicked tab will not become selected (useful for example if switching to the next tab requires a form validation).
 
60
</p>
 
61
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=2" title="Template:UIAPIPlugin">edit</a>]</div><a name="Ajax_mode"></a><h2> Ajax mode </h2>
 
62
<p>Tabs supports loading tab content via Ajax in an unobtrusive manner.
 
63
</p><p>The HTML you need is slightly different from the one that is used for static tabs: A list of links pointing to existing resources (from where the content gets loaded) and no additional containers at all (unobtrusive!). The containers' markup is going to be created on the fly:
 
64
</p>
 
65
<pre>
 
66
&lt;div id=&quot;example&quot;&gt;
 
67
     &lt;ul&gt;
 
68
         &lt;li&gt;&lt;a href=&quot;ahah_1.html&quot;&gt;&lt;span&gt;Content 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
69
         &lt;li&gt;&lt;a href=&quot;ahah_2.html&quot;&gt;&lt;span&gt;Content 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
70
         &lt;li&gt;&lt;a href=&quot;ahah_3.html&quot;&gt;&lt;span&gt;Content 3&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
71
     &lt;/ul&gt;
 
72
&lt;/div&gt;
 
73
</pre>
 
74
<p>Obviously this degrades gracefully - the links, e.g. the content, will still be accessible with JavaScript disabled.
 
75
</p><p>Note that if you wish to reuse an existing container, you
 
76
could do so by matching a title attribute and the container's id:
 
77
</p>
 
78
<pre>
 
79
&lt;li&gt;&lt;a href=&quot;hello/world.html&quot; title=&quot;Todo Overview&quot;&gt; ... &lt;/a&gt;&lt;/li&gt;
 
80
</pre>
 
81
<p>and a container like:
 
82
</p>
 
83
<pre>
 
84
&lt;div id=&quot;Todo_Overview&quot;&gt; ... &lt;/div&gt;
 
85
</pre>
 
86
<p>(Note how white space is replaced with an underscore)
 
87
</p><p>This is useful if you want a human readable hash in the URL instead of
 
88
a cryptic generated one.
 
89
</p>
 
90
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=3" title="Template:UIAPIPlugin">edit</a>]</div><a name="Back_button_and_bookmarking"></a><h3>Back button and bookmarking</h3>
 
91
<p>Tabs 2 already supported this functionality, although the history plugin needs a rewrite first (it doesn't support Safari 3 and is in general a little inflexible) before it can be build back into the tabs. It is planned and Klaus is working on it whenever he finds the time. Actual bugs in the UI Tabs plugin itself always have higher priority though.
 
92
</p>
 
93
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=4" title="Template:UIAPIPlugin">edit</a>]</div><a name="How_to..."></a><h2>How to...</h2>
 
94
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=5" title="Template:UIAPIPlugin">edit</a>]</div><a name="...retrieve_the_index_of_the_currently_selected_tab"></a><h3>...retrieve the index of the currently selected tab</h3>
 
95
<pre>var $tabs = $('#example').tabs();
 
96
var selected = $tabs.tabs('option', 'selected'); // =&gt; 0</pre>
 
97
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=6" title="Template:UIAPIPlugin">edit</a>]</div><a name="...open_links_in_the_current_tab_instead_of_leaving_the_page"></a><h3>...open links in the current tab instead of leaving the page</h3>
 
98
<p>"Hijax" links after tab content has been loaded:
 
99
</p>
 
100
<pre>$('#example').tabs({
 
101
    load: function(event, ui) {
 
102
        $('a', ui.panel).click(function() {
 
103
            $(ui.panel).load(this.href);
 
104
            return false;
 
105
        });
 
106
    }
 
107
});</pre>
 
108
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=7" title="Template:UIAPIPlugin">edit</a>]</div><a name="...select_a_tab_from_a_text_link_instead_of_clicking_a_tab_itself"></a><h3>...select a tab from a text link instead of clicking a tab itself</h3>
 
109
<pre>var $tabs = $('#example').tabs(); // first tab selected
 
110
 
 
111
$('#my-text-link').click(function() { // bind click event to link
 
112
    $tabs.tabs('select', 2); // switch to third tab
 
113
    return false;
 
114
});</pre>
 
115
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=8" title="Template:UIAPIPlugin">edit</a>]</div><a name="...prevent_switching_to_the_tab_on_click_depending_on_form_validation"></a><h3>...prevent switching to the tab on click depending on form validation</h3>
 
116
<p>Returning false in the tabs select handler prevents the clicked tab from becoming selected.
 
117
</p>
 
118
<pre>$('#example').tabs({
 
119
    select: function(event, ui) {
 
120
        var isValid = ... // form validation returning true or false
 
121
        return isValid;
 
122
    }
 
123
});</pre>
 
124
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=9" title="Template:UIAPIPlugin">edit</a>]</div><a name="...immediately_select_a_just_added_tab"></a><h3>...immediately select a just added tab</h3>
 
125
<pre>var $tabs = $('#example').tabs({
 
126
    add: function(event, ui) {
 
127
        $tabs.tabs('select', '#' + ui.panel.id);
 
128
    }
 
129
});</pre>
 
130
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=10" title="Template:UIAPIPlugin">edit</a>]</div><a name="...open_a_tab_in_a_new_window_instead"></a><h3>...open a tab in a new window instead</h3>
 
131
<p>Note that opening a tab in a new window is unexpected, e.g.
 
132
inconsistent behaviour exposing a usablity problem (<a href="http://www.useit.com/alertbox/tabs.html" class="external free" title="http://www.useit.com/alertbox/tabs.html">http://www.useit.com/alertbox/tabs.html</a>).
 
133
</p>
 
134
<pre>$('#example').tabs({
 
135
    select: function(event, ui) {
 
136
        location.href = $.data(ui.tab, 'load.tabs');
 
137
        return false;
 
138
    }
 
139
});</pre>
 
140
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=11" title="Template:UIAPIPlugin">edit</a>]</div><a name="...prevent_a_FOUC_.28Flash_of_Unstyled_Content.29_before_tabs_are_initialized"></a><h3>...prevent a FOUC (Flash of Unstyled Content) before tabs are initialized</h3>
 
141
<p>Add the necessary classes to hide an inactive tab panel to the HTML right away - note that this will <b>not</b> degrade gracefully with JavaScript being disabled:
 
142
</p>
 
143
<pre>&lt;div id=&quot;example&quot; class=&quot;ui-tabs&quot;&gt;
 
144
  ...
 
145
  &lt;div id=&quot;a-tab-panel&quot; class=&quot;ui-tabs-hide&quot;&gt; &lt;/div&gt;
 
146
  ...
 
147
&lt;/div&gt;</pre>
 
148
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=12" title="Template:UIAPIPlugin">edit</a>]</div><a name="Why_does..."></a><h2>Why does...</h2>
 
149
<div class="editsection" style="float:right;margin-left:5px;">[<a href="http://docs.jquery.com/action/edit/Template:UIAPIPlugin?section=13" title="Template:UIAPIPlugin">edit</a>]</div><a name="...my_slider.2C_Google_Map.2C_sIFR_etc._not_work_when_placed_in_a_hidden_.28inactive.29_tab.3F"></a><h3>...my slider, Google Map, sIFR etc. not work when placed in a hidden (inactive) tab?</h3>
 
150
<p>Any component that requires some dimensional computation for its initialization won't work in a hidden tab, because the tab panel itself is hidden via <code>display: none</code> so that any elements inside won't report their actual width and height (0 in most browsers).
 
151
</p><p>There's an easy workaround. Use the <em>off-left technique</em> for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with
 
152
</p>
 
153
<pre>.ui-tabs .ui-tabs-hide {
 
154
    position: absolute;
 
155
    left: -10000px;
 
156
}</pre>
 
157
<p>For Google maps you can also resize the map once the tab is displayed like this:
 
158
</p>
 
159
<pre>$('#example').bind('tabsshow', function(event, ui) {
 
160
    if (ui.panel.id == &quot;map-tab&quot;) {
 
161
        resizeMap();
 
162
    }
 
163
});</pre>
 
164
resizeMap() will call Google Maps' checkResize() on the particular map.
 
165
    </div>
 
166
    <div id="overview-dependencies">
 
167
        <h3>Dependencies</h3>
 
168
        <ul>
 
169
<li>UI Core</li>
 
170
<li>To use the cookie option: <a href="http://plugins.jquery.com/project/cookie" class="external text" title="http://plugins.jquery.com/project/cookie">jquery.cookie.js</a></li>
 
171
<li>Required CSS:
 
172
<pre>.ui-tabs .ui-tabs-hide {
 
173
     display: none;
 
174
}</pre></li>
 
175
</ul>
 
176
    </div>
 
177
    <div id="overview-example">
 
178
        <h3>Example</h3>
 
179
        <div id="overview-example" class="example">
 
180
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
 
181
<p><div id="demo" class="tabs-container" rel="295">
 
182
A simple jQuery UI Tabs.<br />
 
183
</p>
 
184
<pre>$(&quot;#tabs&quot;).tabs();
 
185
</pre>
 
186
<p></div><div id="source" class="tabs-container">
 
187
</p>
 
188
<pre>&lt;!DOCTYPE html&gt;
 
189
&lt;html&gt;
 
190
&lt;head&gt;
 
191
  &lt;link type=&quot;text/css&quot; href=&quot;http://jqueryui.com/latest/themes/base/ui.all.css&quot; rel=&quot;stylesheet&quot; /&gt;
 
192
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/jquery-1.3.2.js&quot;&gt;&lt;/script&gt;
 
193
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.core.js&quot;&gt;&lt;/script&gt;
 
194
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.tabs.js&quot;&gt;&lt;/script&gt;
 
195
  &lt;script type="text/javascript"&gt;
 
196
  $(document).ready(function(){
 
197
    $(&quot;#tabs&quot;).tabs();
 
198
  });
 
199
  &lt;/script&gt;
 
200
&lt;/head&gt;
 
201
&lt;body style="font-size:62.5%;"&gt;
 
202
  
 
203
&lt;div id=&quot;tabs&quot;&gt;
 
204
    &lt;ul&gt;
 
205
        &lt;li&gt;&lt;a href=&quot;#fragment-1&quot;&gt;&lt;span&gt;One&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
206
        &lt;li&gt;&lt;a href=&quot;#fragment-2&quot;&gt;&lt;span&gt;Two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
207
        &lt;li&gt;&lt;a href=&quot;#fragment-3&quot;&gt;&lt;span&gt;Three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 
208
    &lt;/ul&gt;
 
209
    &lt;div id=&quot;fragment-1&quot;&gt;
 
210
        &lt;p&gt;First tab is active by default:&lt;/p&gt;
 
211
        &lt;pre&gt;&lt;code&gt;$('#example').tabs();&lt;/code&gt;&lt;/pre&gt;
 
212
    &lt;/div&gt;
 
213
    &lt;div id=&quot;fragment-2&quot;&gt;
 
214
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
 
215
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
 
216
    &lt;/div&gt;
 
217
    &lt;div id=&quot;fragment-3&quot;&gt;
 
218
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
 
219
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
 
220
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
 
221
    &lt;/div&gt;
 
222
&lt;/div&gt;
 
223
&lt;/body&gt;
 
224
&lt;/html&gt;
 
225
</pre>
 
226
<p></div>
 
227
</p><p></div>
 
228
    </div>
 
229
  </div>
 
230
  <div id="options">
 
231
    <h2 class="top-header">Options</h2>
 
232
    <ul class="options-list">
 
233
      
 
234
<li class="option" id="option-ajaxOptions">
 
235
  <div class="option-header">
 
236
    <h3 class="option-name"><a href="#option-ajaxOptions">ajaxOptions</a></h3>
 
237
    <dl>
 
238
      <dt class="option-type-label">Type:</dt>
 
239
        <dd class="option-type">Options</dd>
 
240
      
 
241
      <dt class="option-default-label">Default:</dt>
 
242
        <dd class="option-default">null</dd>
 
243
      
 
244
    </dl>
 
245
  </div>
 
246
  <div class="option-description">
 
247
    <p>Additional Ajax options to consider when loading tab content (see $.ajax).</p>
 
248
  </div>
 
249
  <div class="option-examples">
 
250
    <h4>Code examples</h4>
 
251
    <dl class="option-examples-list">
 
252
    
 
253
<dt>
 
254
  Initialize a tabs with the <code>ajaxOptions</code> option specified.
 
255
</dt>
 
256
<dd>
 
257
<pre><code>$('.selector').tabs({ ajaxOptions: { async: false } });</code></pre>
 
258
</dd>
 
259
 
 
260
    
 
261
<dt>
 
262
  Get or set the <code>ajaxOptions</code> option, after init.
 
263
</dt>
 
264
<dd>
 
265
<pre><code>//getter
 
266
var ajaxOptions = $('.selector').tabs('option', 'ajaxOptions');
 
267
//setter
 
268
$('.selector').tabs('option', 'ajaxOptions', { async: false });</code></pre>
 
269
</dd>
 
270
 
 
271
    </dl>
 
272
  </div>
 
273
</li>
 
274
 
 
275
 
 
276
<li class="option" id="option-cache">
 
277
  <div class="option-header">
 
278
    <h3 class="option-name"><a href="#option-cache">cache</a></h3>
 
279
    <dl>
 
280
      <dt class="option-type-label">Type:</dt>
 
281
        <dd class="option-type">Boolean</dd>
 
282
      
 
283
      <dt class="option-default-label">Default:</dt>
 
284
        <dd class="option-default">false</dd>
 
285
      
 
286
    </dl>
 
287
  </div>
 
288
  <div class="option-description">
 
289
    <p>Whether or not to cache remote tabs content, e.g. load only once or with every click. Cached content is being lazy loaded, e.g once and only once for the first click. Note that to prevent the actual Ajax requests from being cached by the browser you need to provide an extra cache: false flag to ajaxOptions.</p>
 
290
  </div>
 
291
  <div class="option-examples">
 
292
    <h4>Code examples</h4>
 
293
    <dl class="option-examples-list">
 
294
    
 
295
<dt>
 
296
  Initialize a tabs with the <code>cache</code> option specified.
 
297
</dt>
 
298
<dd>
 
299
<pre><code>$('.selector').tabs({ cache: true });</code></pre>
 
300
</dd>
 
301
 
 
302
    
 
303
<dt>
 
304
  Get or set the <code>cache</code> option, after init.
 
305
</dt>
 
306
<dd>
 
307
<pre><code>//getter
 
308
var cache = $('.selector').tabs('option', 'cache');
 
309
//setter
 
310
$('.selector').tabs('option', 'cache', true);</code></pre>
 
311
</dd>
 
312
 
 
313
    </dl>
 
314
  </div>
 
315
</li>
 
316
 
 
317
 
 
318
<li class="option" id="option-collapsible">
 
319
  <div class="option-header">
 
320
    <h3 class="option-name"><a href="#option-collapsible">collapsible</a></h3>
 
321
    <dl>
 
322
      <dt class="option-type-label">Type:</dt>
 
323
        <dd class="option-type">Boolean</dd>
 
324
      
 
325
      <dt class="option-default-label">Default:</dt>
 
326
        <dd class="option-default">false</dd>
 
327
      
 
328
    </dl>
 
329
  </div>
 
330
  <div class="option-description">
 
331
    <p>Set to true to allow an already selected tab to become unselected again upon reselection.</p>
 
332
  </div>
 
333
  <div class="option-examples">
 
334
    <h4>Code examples</h4>
 
335
    <dl class="option-examples-list">
 
336
    
 
337
<dt>
 
338
  Initialize a tabs with the <code>collapsible</code> option specified.
 
339
</dt>
 
340
<dd>
 
341
<pre><code>$('.selector').tabs({ collapsible: true });</code></pre>
 
342
</dd>
 
343
 
 
344
    
 
345
<dt>
 
346
  Get or set the <code>collapsible</code> option, after init.
 
347
</dt>
 
348
<dd>
 
349
<pre><code>//getter
 
350
var collapsible = $('.selector').tabs('option', 'collapsible');
 
351
//setter
 
352
$('.selector').tabs('option', 'collapsible', true);</code></pre>
 
353
</dd>
 
354
 
 
355
    </dl>
 
356
  </div>
 
357
</li>
 
358
 
 
359
 
 
360
<li class="option" id="option-cookie">
 
361
  <div class="option-header">
 
362
    <h3 class="option-name"><a href="#option-cookie">cookie</a></h3>
 
363
    <dl>
 
364
      <dt class="option-type-label">Type:</dt>
 
365
        <dd class="option-type">Object</dd>
 
366
      
 
367
      <dt class="option-default-label">Default:</dt>
 
368
        <dd class="option-default">null</dd>
 
369
      
 
370
    </dl>
 
371
  </div>
 
372
  <div class="option-description">
 
373
    <p>Store the latest selected tab in a cookie. The cookie is then used to determine the initially selected tab if the <i>selected</i> option is not defined. Requires cookie plugin. The object needs to have key/value pairs of the form the cookie plugin expects as options. Available options (example): &#123; expires: 7, path: '/', domain: 'jquery.com', secure: true &#125;. Since jQuery UI 1.7 it is also possible to define the cookie name being used via <i>name</i> property.</p>
 
374
  </div>
 
375
  <div class="option-examples">
 
376
    <h4>Code examples</h4>
 
377
    <dl class="option-examples-list">
 
378
    
 
379
<dt>
 
380
  Initialize a tabs with the <code>cookie</code> option specified.
 
381
</dt>
 
382
<dd>
 
383
<pre><code>$('.selector').tabs({ cookie: { expires: 30 } });</code></pre>
 
384
</dd>
 
385
 
 
386
    
 
387
<dt>
 
388
  Get or set the <code>cookie</code> option, after init.
 
389
</dt>
 
390
<dd>
 
391
<pre><code>//getter
 
392
var cookie = $('.selector').tabs('option', 'cookie');
 
393
//setter
 
394
$('.selector').tabs('option', 'cookie', { expires: 30 });</code></pre>
 
395
</dd>
 
396
 
 
397
    </dl>
 
398
  </div>
 
399
</li>
 
400
 
 
401
 
 
402
<li class="option" id="option-deselectable">
 
403
  <div class="option-header">
 
404
    <h3 class="option-name"><a href="#option-deselectable">deselectable</a></h3>
 
405
    <dl>
 
406
      <dt class="option-type-label">Type:</dt>
 
407
        <dd class="option-type">Boolean</dd>
 
408
      
 
409
      <dt class="option-default-label">Default:</dt>
 
410
        <dd class="option-default">false</dd>
 
411
      
 
412
    </dl>
 
413
  </div>
 
414
  <div class="option-description">
 
415
    <p>deprecated in jQuery UI 1.7, use collapsible.</p>
 
416
  </div>
 
417
  <div class="option-examples">
 
418
    <h4>Code examples</h4>
 
419
    <dl class="option-examples-list">
 
420
    
 
421
<dt>
 
422
  Initialize a tabs with the <code>deselectable</code> option specified.
 
423
</dt>
 
424
<dd>
 
425
<pre><code>$('.selector').tabs({ deselectable: true });</code></pre>
 
426
</dd>
 
427
 
 
428
    
 
429
<dt>
 
430
  Get or set the <code>deselectable</code> option, after init.
 
431
</dt>
 
432
<dd>
 
433
<pre><code>//getter
 
434
var deselectable = $('.selector').tabs('option', 'deselectable');
 
435
//setter
 
436
$('.selector').tabs('option', 'deselectable', true);</code></pre>
 
437
</dd>
 
438
 
 
439
    </dl>
 
440
  </div>
 
441
</li>
 
442
 
 
443
 
 
444
<li class="option" id="option-disabled">
 
445
  <div class="option-header">
 
446
    <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
 
447
    <dl>
 
448
      <dt class="option-type-label">Type:</dt>
 
449
        <dd class="option-type">Array&lt;Number&gt;</dd>
 
450
      
 
451
      <dt class="option-default-label">Default:</dt>
 
452
        <dd class="option-default">[]</dd>
 
453
      
 
454
    </dl>
 
455
  </div>
 
456
  <div class="option-description">
 
457
    <p>An array containing the position of the tabs (zero-based index) that should be disabled on initialization.</p>
 
458
  </div>
 
459
  <div class="option-examples">
 
460
    <h4>Code examples</h4>
 
461
    <dl class="option-examples-list">
 
462
    
 
463
<dt>
 
464
  Initialize a tabs with the <code>disabled</code> option specified.
 
465
</dt>
 
466
<dd>
 
467
<pre><code>$('.selector').tabs({ disabled: [1, 2] });</code></pre>
 
468
</dd>
 
469
 
 
470
    
 
471
<dt>
 
472
  Get or set the <code>disabled</code> option, after init.
 
473
</dt>
 
474
<dd>
 
475
<pre><code>//getter
 
476
var disabled = $('.selector').tabs('option', 'disabled');
 
477
//setter
 
478
$('.selector').tabs('option', 'disabled', [1, 2]);</code></pre>
 
479
</dd>
 
480
 
 
481
    </dl>
 
482
  </div>
 
483
</li>
 
484
 
 
485
 
 
486
<li class="option" id="option-event">
 
487
  <div class="option-header">
 
488
    <h3 class="option-name"><a href="#option-event">event</a></h3>
 
489
    <dl>
 
490
      <dt class="option-type-label">Type:</dt>
 
491
        <dd class="option-type">String</dd>
 
492
      
 
493
      <dt class="option-default-label">Default:</dt>
 
494
        <dd class="option-default">'click'</dd>
 
495
      
 
496
    </dl>
 
497
  </div>
 
498
  <div class="option-description">
 
499
    <p>The type of event to be used for selecting a tab.</p>
 
500
  </div>
 
501
  <div class="option-examples">
 
502
    <h4>Code examples</h4>
 
503
    <dl class="option-examples-list">
 
504
    
 
505
<dt>
 
506
  Initialize a tabs with the <code>event</code> option specified.
 
507
</dt>
 
508
<dd>
 
509
<pre><code>$('.selector').tabs({ event: 'mouseover' });</code></pre>
 
510
</dd>
 
511
 
 
512
    
 
513
<dt>
 
514
  Get or set the <code>event</code> option, after init.
 
515
</dt>
 
516
<dd>
 
517
<pre><code>//getter
 
518
var event = $('.selector').tabs('option', 'event');
 
519
//setter
 
520
$('.selector').tabs('option', 'event', 'mouseover');</code></pre>
 
521
</dd>
 
522
 
 
523
    </dl>
 
524
  </div>
 
525
</li>
 
526
 
 
527
 
 
528
<li class="option" id="option-fx">
 
529
  <div class="option-header">
 
530
    <h3 class="option-name"><a href="#option-fx">fx</a></h3>
 
531
    <dl>
 
532
      <dt class="option-type-label">Type:</dt>
 
533
        <dd class="option-type">Options, Array&lt;Options&gt;</dd>
 
534
      
 
535
      <dt class="option-default-label">Default:</dt>
 
536
        <dd class="option-default">null</dd>
 
537
      
 
538
    </dl>
 
539
  </div>
 
540
  <div class="option-description">
 
541
    <p>Enable animations for hiding and showing tab panels. The duration option can be a string representing one of the three predefined speeds ("slow", "normal", "fast") or the duration in milliseconds to run an animation (default is "normal").</p>
 
542
  </div>
 
543
  <div class="option-examples">
 
544
    <h4>Code examples</h4>
 
545
    <dl class="option-examples-list">
 
546
    
 
547
<dt>
 
548
  Initialize a tabs with the <code>fx</code> option specified.
 
549
</dt>
 
550
<dd>
 
551
<pre><code>$('.selector').tabs({ fx: { opacity: 'toggle' } });</code></pre>
 
552
</dd>
 
553
 
 
554
    
 
555
<dt>
 
556
  Get or set the <code>fx</code> option, after init.
 
557
</dt>
 
558
<dd>
 
559
<pre><code>//getter
 
560
var fx = $('.selector').tabs('option', 'fx');
 
561
//setter
 
562
$('.selector').tabs('option', 'fx', { opacity: 'toggle' });</code></pre>
 
563
</dd>
 
564
 
 
565
    </dl>
 
566
  </div>
 
567
</li>
 
568
 
 
569
 
 
570
<li class="option" id="option-idPrefix">
 
571
  <div class="option-header">
 
572
    <h3 class="option-name"><a href="#option-idPrefix">idPrefix</a></h3>
 
573
    <dl>
 
574
      <dt class="option-type-label">Type:</dt>
 
575
        <dd class="option-type">String</dd>
 
576
      
 
577
      <dt class="option-default-label">Default:</dt>
 
578
        <dd class="option-default">'ui-tabs-'</dd>
 
579
      
 
580
    </dl>
 
581
  </div>
 
582
  <div class="option-description">
 
583
    <p>If the remote tab, its anchor element that is, has no title attribute to generate an id from, an id/fragment identifier is created from this prefix and a unique id returned by $.data(el), for example "ui-tabs-54".</p>
 
584
  </div>
 
585
  <div class="option-examples">
 
586
    <h4>Code examples</h4>
 
587
    <dl class="option-examples-list">
 
588
    
 
589
<dt>
 
590
  Initialize a tabs with the <code>idPrefix</code> option specified.
 
591
</dt>
 
592
<dd>
 
593
<pre><code>$('.selector').tabs({ idPrefix: 'ui-tabs-primary' });</code></pre>
 
594
</dd>
 
595
 
 
596
    
 
597
<dt>
 
598
  Get or set the <code>idPrefix</code> option, after init.
 
599
</dt>
 
600
<dd>
 
601
<pre><code>//getter
 
602
var idPrefix = $('.selector').tabs('option', 'idPrefix');
 
603
//setter
 
604
$('.selector').tabs('option', 'idPrefix', 'ui-tabs-primary');</code></pre>
 
605
</dd>
 
606
 
 
607
    </dl>
 
608
  </div>
 
609
</li>
 
610
 
 
611
 
 
612
<li class="option" id="option-panelTemplate">
 
613
  <div class="option-header">
 
614
    <h3 class="option-name"><a href="#option-panelTemplate">panelTemplate</a></h3>
 
615
    <dl>
 
616
      <dt class="option-type-label">Type:</dt>
 
617
        <dd class="option-type">String</dd>
 
618
      
 
619
      <dt class="option-default-label">Default:</dt>
 
620
        <dd class="option-default">'&lt;div&gt;&lt;/div&gt;'</dd>
 
621
      
 
622
    </dl>
 
623
  </div>
 
624
  <div class="option-description">
 
625
    <p>HTML template from which a new tab panel is created in case of adding a tab with the add method or when creating a panel for a remote tab on the fly.</p>
 
626
  </div>
 
627
  <div class="option-examples">
 
628
    <h4>Code examples</h4>
 
629
    <dl class="option-examples-list">
 
630
    
 
631
<dt>
 
632
  Initialize a tabs with the <code>panelTemplate</code> option specified.
 
633
</dt>
 
634
<dd>
 
635
<pre><code>$('.selector').tabs({ panelTemplate: '&lt;li&gt;&lt;/li&gt;' });</code></pre>
 
636
</dd>
 
637
 
 
638
    
 
639
<dt>
 
640
  Get or set the <code>panelTemplate</code> option, after init.
 
641
</dt>
 
642
<dd>
 
643
<pre><code>//getter
 
644
var panelTemplate = $('.selector').tabs('option', 'panelTemplate');
 
645
//setter
 
646
$('.selector').tabs('option', 'panelTemplate', '&lt;li&gt;&lt;/li&gt;');</code></pre>
 
647
</dd>
 
648
 
 
649
    </dl>
 
650
  </div>
 
651
</li>
 
652
 
 
653
 
 
654
<li class="option" id="option-selected">
 
655
  <div class="option-header">
 
656
    <h3 class="option-name"><a href="#option-selected">selected</a></h3>
 
657
    <dl>
 
658
      <dt class="option-type-label">Type:</dt>
 
659
        <dd class="option-type">Number</dd>
 
660
      
 
661
      <dt class="option-default-label">Default:</dt>
 
662
        <dd class="option-default">0</dd>
 
663
      
 
664
    </dl>
 
665
  </div>
 
666
  <div class="option-description">
 
667
    <p>Zero-based index of the tab to be selected on initialization. To set all tabs to nselected pass -1 as value.</p>
 
668
  </div>
 
669
  <div class="option-examples">
 
670
    <h4>Code examples</h4>
 
671
    <dl class="option-examples-list">
 
672
    
 
673
<dt>
 
674
  Initialize a tabs with the <code>selected</code> option specified.
 
675
</dt>
 
676
<dd>
 
677
<pre><code>$('.selector').tabs({ selected: 3 });</code></pre>
 
678
</dd>
 
679
 
 
680
    
 
681
<dt>
 
682
  Get or set the <code>selected</code> option, after init.
 
683
</dt>
 
684
<dd>
 
685
<pre><code>//getter
 
686
var selected = $('.selector').tabs('option', 'selected');
 
687
//setter
 
688
$('.selector').tabs('option', 'selected', 3);</code></pre>
 
689
</dd>
 
690
 
 
691
    </dl>
 
692
  </div>
 
693
</li>
 
694
 
 
695
 
 
696
<li class="option" id="option-spinner">
 
697
  <div class="option-header">
 
698
    <h3 class="option-name"><a href="#option-spinner">spinner</a></h3>
 
699
    <dl>
 
700
      <dt class="option-type-label">Type:</dt>
 
701
        <dd class="option-type">String</dd>
 
702
      
 
703
      <dt class="option-default-label">Default:</dt>
 
704
        <dd class="option-default">'&lt;em&gt;Loading&amp;#8230;&lt;/em&gt;'</dd>
 
705
      
 
706
    </dl>
 
707
  </div>
 
708
  <div class="option-description">
 
709
    <p>The HTML content of this string is shown in a tab title while remote content is loading. Pass in empty string to deactivate that behavior.</p>
 
710
  </div>
 
711
  <div class="option-examples">
 
712
    <h4>Code examples</h4>
 
713
    <dl class="option-examples-list">
 
714
    
 
715
<dt>
 
716
  Initialize a tabs with the <code>spinner</code> option specified.
 
717
</dt>
 
718
<dd>
 
719
<pre><code>$('.selector').tabs({ spinner: 'Retrieving data...' });</code></pre>
 
720
</dd>
 
721
 
 
722
    
 
723
<dt>
 
724
  Get or set the <code>spinner</code> option, after init.
 
725
</dt>
 
726
<dd>
 
727
<pre><code>//getter
 
728
var spinner = $('.selector').tabs('option', 'spinner');
 
729
//setter
 
730
$('.selector').tabs('option', 'spinner', 'Retrieving data...');</code></pre>
 
731
</dd>
 
732
 
 
733
    </dl>
 
734
  </div>
 
735
</li>
 
736
 
 
737
 
 
738
<li class="option" id="option-tabTemplate">
 
739
  <div class="option-header">
 
740
    <h3 class="option-name"><a href="#option-tabTemplate">tabTemplate</a></h3>
 
741
    <dl>
 
742
      <dt class="option-type-label">Type:</dt>
 
743
        <dd class="option-type">String</dd>
 
744
      
 
745
      <dt class="option-default-label">Default:</dt>
 
746
        <dd class="option-default">'&lt;li&gt;&lt;a href&#61;"#&#123;href&#125;"&gt;&lt;span&gt;#&#123;label&#125;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;'</dd>
 
747
      
 
748
    </dl>
 
749
  </div>
 
750
  <div class="option-description">
 
751
    <p>HTML template from which a new tab is created and added. The placeholders #&#123;href&#125; and #&#123;label&#125; are replaced with the url and tab label that are passed as arguments to the add method.</p>
 
752
  </div>
 
753
  <div class="option-examples">
 
754
    <h4>Code examples</h4>
 
755
    <dl class="option-examples-list">
 
756
    
 
757
<dt>
 
758
  Initialize a tabs with the <code>tabTemplate</code> option specified.
 
759
</dt>
 
760
<dd>
 
761
<pre><code>$('.selector').tabs({ tabTemplate: '&lt;div&gt;&lt;a href&#61;"#&#123;href&#125;"&gt;&lt;span&gt;#&#123;label&#125;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;' });</code></pre>
 
762
</dd>
 
763
 
 
764
    
 
765
<dt>
 
766
  Get or set the <code>tabTemplate</code> option, after init.
 
767
</dt>
 
768
<dd>
 
769
<pre><code>//getter
 
770
var tabTemplate = $('.selector').tabs('option', 'tabTemplate');
 
771
//setter
 
772
$('.selector').tabs('option', 'tabTemplate', '&lt;div&gt;&lt;a href&#61;"#&#123;href&#125;"&gt;&lt;span&gt;#&#123;label&#125;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;');</code></pre>
 
773
</dd>
 
774
 
 
775
    </dl>
 
776
  </div>
 
777
</li>
 
778
 
 
779
    </ul>
 
780
  </div>
 
781
  <div id="events">
 
782
    <h2 class="top-header">Events</h2>
 
783
    <ul class="events-list">
 
784
      
 
785
<li class="event" id="event-select">
 
786
  <div class="event-header">
 
787
    <h3 class="event-name"><a href="#event-select">select</a></h3>
 
788
    <dl>
 
789
      <dt class="event-type-label">Type:</dt>
 
790
        <dd class="event-type">tabsselect</dd>
 
791
    </dl>
 
792
  </div>
 
793
  <div class="event-description">
 
794
    <p>This event is triggered when clicking a tab.</p>
 
795
  </div>
 
796
  <div class="event-examples">
 
797
    <h4>Code examples</h4>
 
798
    <dl class="event-examples-list">
 
799
    
 
800
<dt>
 
801
  Supply a callback function to handle the <code>select</code> event as an init option.
 
802
</dt>
 
803
<dd>
 
804
<pre><code>$('.selector').tabs({
 
805
   select: function(event, ui) { ... }
 
806
});</code></pre>
 
807
</dd>
 
808
 
 
809
    
 
810
<dt>
 
811
  Bind to the <code>select</code> event by type: <code>tabsselect</code>.
 
812
</dt>
 
813
<dd>
 
814
<pre><code>$('.selector').bind('tabsselect', function(event, ui) {
 
815
  ...
 
816
});</code></pre>
 
817
</dd>
 
818
 
 
819
    </dl>
 
820
  </div>
 
821
</li>
 
822
 
 
823
 
 
824
<li class="event" id="event-load">
 
825
  <div class="event-header">
 
826
    <h3 class="event-name"><a href="#event-load">load</a></h3>
 
827
    <dl>
 
828
      <dt class="event-type-label">Type:</dt>
 
829
        <dd class="event-type">tabsload</dd>
 
830
    </dl>
 
831
  </div>
 
832
  <div class="event-description">
 
833
    <p>This event is triggered after the content of a remote tab has been loaded.</p>
 
834
  </div>
 
835
  <div class="event-examples">
 
836
    <h4>Code examples</h4>
 
837
    <dl class="event-examples-list">
 
838
    
 
839
<dt>
 
840
  Supply a callback function to handle the <code>load</code> event as an init option.
 
841
</dt>
 
842
<dd>
 
843
<pre><code>$('.selector').tabs({
 
844
   load: function(event, ui) { ... }
 
845
});</code></pre>
 
846
</dd>
 
847
 
 
848
    
 
849
<dt>
 
850
  Bind to the <code>load</code> event by type: <code>tabsload</code>.
 
851
</dt>
 
852
<dd>
 
853
<pre><code>$('.selector').bind('tabsload', function(event, ui) {
 
854
  ...
 
855
});</code></pre>
 
856
</dd>
 
857
 
 
858
    </dl>
 
859
  </div>
 
860
</li>
 
861
 
 
862
 
 
863
<li class="event" id="event-show">
 
864
  <div class="event-header">
 
865
    <h3 class="event-name"><a href="#event-show">show</a></h3>
 
866
    <dl>
 
867
      <dt class="event-type-label">Type:</dt>
 
868
        <dd class="event-type">tabsshow</dd>
 
869
    </dl>
 
870
  </div>
 
871
  <div class="event-description">
 
872
    <p>This event is triggered when a tab is shown.</p>
 
873
  </div>
 
874
  <div class="event-examples">
 
875
    <h4>Code examples</h4>
 
876
    <dl class="event-examples-list">
 
877
    
 
878
<dt>
 
879
  Supply a callback function to handle the <code>show</code> event as an init option.
 
880
</dt>
 
881
<dd>
 
882
<pre><code>$('.selector').tabs({
 
883
   show: function(event, ui) { ... }
 
884
});</code></pre>
 
885
</dd>
 
886
 
 
887
    
 
888
<dt>
 
889
  Bind to the <code>show</code> event by type: <code>tabsshow</code>.
 
890
</dt>
 
891
<dd>
 
892
<pre><code>$('.selector').bind('tabsshow', function(event, ui) {
 
893
  ...
 
894
});</code></pre>
 
895
</dd>
 
896
 
 
897
    </dl>
 
898
  </div>
 
899
</li>
 
900
 
 
901
 
 
902
<li class="event" id="event-add">
 
903
  <div class="event-header">
 
904
    <h3 class="event-name"><a href="#event-add">add</a></h3>
 
905
    <dl>
 
906
      <dt class="event-type-label">Type:</dt>
 
907
        <dd class="event-type">tabsadd</dd>
 
908
    </dl>
 
909
  </div>
 
910
  <div class="event-description">
 
911
    <p>This event is triggered when a tab is added.</p>
 
912
  </div>
 
913
  <div class="event-examples">
 
914
    <h4>Code examples</h4>
 
915
    <dl class="event-examples-list">
 
916
    
 
917
<dt>
 
918
  Supply a callback function to handle the <code>add</code> event as an init option.
 
919
</dt>
 
920
<dd>
 
921
<pre><code>$('.selector').tabs({
 
922
   add: function(event, ui) { ... }
 
923
});</code></pre>
 
924
</dd>
 
925
 
 
926
    
 
927
<dt>
 
928
  Bind to the <code>add</code> event by type: <code>tabsadd</code>.
 
929
</dt>
 
930
<dd>
 
931
<pre><code>$('.selector').bind('tabsadd', function(event, ui) {
 
932
  ...
 
933
});</code></pre>
 
934
</dd>
 
935
 
 
936
    </dl>
 
937
  </div>
 
938
</li>
 
939
 
 
940
 
 
941
<li class="event" id="event-remove">
 
942
  <div class="event-header">
 
943
    <h3 class="event-name"><a href="#event-remove">remove</a></h3>
 
944
    <dl>
 
945
      <dt class="event-type-label">Type:</dt>
 
946
        <dd class="event-type">tabsremove</dd>
 
947
    </dl>
 
948
  </div>
 
949
  <div class="event-description">
 
950
    <p>This event is triggered when a tab is removed.</p>
 
951
  </div>
 
952
  <div class="event-examples">
 
953
    <h4>Code examples</h4>
 
954
    <dl class="event-examples-list">
 
955
    
 
956
<dt>
 
957
  Supply a callback function to handle the <code>remove</code> event as an init option.
 
958
</dt>
 
959
<dd>
 
960
<pre><code>$('.selector').tabs({
 
961
   remove: function(event, ui) { ... }
 
962
});</code></pre>
 
963
</dd>
 
964
 
 
965
    
 
966
<dt>
 
967
  Bind to the <code>remove</code> event by type: <code>tabsremove</code>.
 
968
</dt>
 
969
<dd>
 
970
<pre><code>$('.selector').bind('tabsremove', function(event, ui) {
 
971
  ...
 
972
});</code></pre>
 
973
</dd>
 
974
 
 
975
    </dl>
 
976
  </div>
 
977
</li>
 
978
 
 
979
 
 
980
<li class="event" id="event-enable">
 
981
  <div class="event-header">
 
982
    <h3 class="event-name"><a href="#event-enable">enable</a></h3>
 
983
    <dl>
 
984
      <dt class="event-type-label">Type:</dt>
 
985
        <dd class="event-type">tabsenable</dd>
 
986
    </dl>
 
987
  </div>
 
988
  <div class="event-description">
 
989
    <p>This event is triggered when a tab is enabled.</p>
 
990
  </div>
 
991
  <div class="event-examples">
 
992
    <h4>Code examples</h4>
 
993
    <dl class="event-examples-list">
 
994
    
 
995
<dt>
 
996
  Supply a callback function to handle the <code>enable</code> event as an init option.
 
997
</dt>
 
998
<dd>
 
999
<pre><code>$('.selector').tabs({
 
1000
   enable: function(event, ui) { ... }
 
1001
});</code></pre>
 
1002
</dd>
 
1003
 
 
1004
    
 
1005
<dt>
 
1006
  Bind to the <code>enable</code> event by type: <code>tabsenable</code>.
 
1007
</dt>
 
1008
<dd>
 
1009
<pre><code>$('.selector').bind('tabsenable', function(event, ui) {
 
1010
  ...
 
1011
});</code></pre>
 
1012
</dd>
 
1013
 
 
1014
    </dl>
 
1015
  </div>
 
1016
</li>
 
1017
 
 
1018
 
 
1019
<li class="event" id="event-disable">
 
1020
  <div class="event-header">
 
1021
    <h3 class="event-name"><a href="#event-disable">disable</a></h3>
 
1022
    <dl>
 
1023
      <dt class="event-type-label">Type:</dt>
 
1024
        <dd class="event-type">tabsdisable</dd>
 
1025
    </dl>
 
1026
  </div>
 
1027
  <div class="event-description">
 
1028
    <p>This event is triggered when a tab is disabled.</p>
 
1029
  </div>
 
1030
  <div class="event-examples">
 
1031
    <h4>Code examples</h4>
 
1032
    <dl class="event-examples-list">
 
1033
    
 
1034
<dt>
 
1035
  Supply a callback function to handle the <code>disable</code> event as an init option.
 
1036
</dt>
 
1037
<dd>
 
1038
<pre><code>$('.selector').tabs({
 
1039
   disable: function(event, ui) { ... }
 
1040
});</code></pre>
 
1041
</dd>
 
1042
 
 
1043
    
 
1044
<dt>
 
1045
  Bind to the <code>disable</code> event by type: <code>tabsdisable</code>.
 
1046
</dt>
 
1047
<dd>
 
1048
<pre><code>$('.selector').bind('tabsdisable', function(event, ui) {
 
1049
  ...
 
1050
});</code></pre>
 
1051
</dd>
 
1052
 
 
1053
    </dl>
 
1054
  </div>
 
1055
</li>
 
1056
 
 
1057
    </ul>
 
1058
  </div>
 
1059
  <div id="methods">
 
1060
    <h2 class="top-header">Methods</h2>
 
1061
    <ul class="methods-list">
 
1062
      
 
1063
<li class="method" id="method-destroy">
 
1064
  <div class="method-header">
 
1065
    <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
 
1066
    <dl>
 
1067
      <dt class="method-signature-label">Signature:</dt>
 
1068
        <dd class="method-signature">.tabs( 'destroy'
 
1069
 
 
1070
 
 
1071
 
 
1072
 
 
1073
 
 
1074
 
 
1075
 
 
1076
)</dd>
 
1077
    </dl>
 
1078
  </div>
 
1079
  <div class="method-description">
 
1080
    <p>Remove the tabs functionality completely. This will return the element back to its pre-init state.</p>
 
1081
  </div>
 
1082
</li>
 
1083
 
 
1084
 
 
1085
<li class="method" id="method-disable">
 
1086
  <div class="method-header">
 
1087
    <h3 class="method-name"><a href="#method-disable">disable</a></h3>
 
1088
    <dl>
 
1089
      <dt class="method-signature-label">Signature:</dt>
 
1090
        <dd class="method-signature">.tabs( 'disable'
 
1091
 
 
1092
 
 
1093
 
 
1094
 
 
1095
 
 
1096
 
 
1097
 
 
1098
)</dd>
 
1099
    </dl>
 
1100
  </div>
 
1101
  <div class="method-description">
 
1102
    <p>Disable the tabs.</p>
 
1103
  </div>
 
1104
</li>
 
1105
 
 
1106
 
 
1107
<li class="method" id="method-enable">
 
1108
  <div class="method-header">
 
1109
    <h3 class="method-name"><a href="#method-enable">enable</a></h3>
 
1110
    <dl>
 
1111
      <dt class="method-signature-label">Signature:</dt>
 
1112
        <dd class="method-signature">.tabs( 'enable'
 
1113
 
 
1114
 
 
1115
 
 
1116
 
 
1117
 
 
1118
 
 
1119
 
 
1120
)</dd>
 
1121
    </dl>
 
1122
  </div>
 
1123
  <div class="method-description">
 
1124
    <p>Enable the tabs.</p>
 
1125
  </div>
 
1126
</li>
 
1127
 
 
1128
 
 
1129
<li class="method" id="method-option">
 
1130
  <div class="method-header">
 
1131
    <h3 class="method-name"><a href="#method-option">option</a></h3>
 
1132
    <dl>
 
1133
      <dt class="method-signature-label">Signature:</dt>
 
1134
        <dd class="method-signature">.tabs( 'option'
 
1135
 
 
1136
, optionName
 
1137
 
 
1138
, <span class="optional">[</span>value<span class="optional">] </span>
 
1139
 
 
1140
 
 
1141
 
 
1142
)</dd>
 
1143
    </dl>
 
1144
  </div>
 
1145
  <div class="method-description">
 
1146
    <p>Get or set any tabs option. If no value is specified, will act as a getter.</p>
 
1147
  </div>
 
1148
</li>
 
1149
 
 
1150
 
 
1151
<li class="method" id="method-add">
 
1152
  <div class="method-header">
 
1153
    <h3 class="method-name"><a href="#method-add">add</a></h3>
 
1154
    <dl>
 
1155
      <dt class="method-signature-label">Signature:</dt>
 
1156
        <dd class="method-signature">.tabs( 'add'
 
1157
 
 
1158
, url
 
1159
 
 
1160
, label
 
1161
 
 
1162
, <span class="optional">[</span>index<span class="optional">] </span>
 
1163
 
 
1164
)</dd>
 
1165
    </dl>
 
1166
  </div>
 
1167
  <div class="method-description">
 
1168
    <p>Add a new tab. The second argument is either a URL consisting of a fragment identifier only to create an in-page tab or a full url (relative or absolute, no cross-domain support) to turn the new tab into an Ajax (remote) tab. The third is the zero-based position where to insert the new tab. Optional, by default a new tab is appended at the end.</p>
 
1169
  </div>
 
1170
</li>
 
1171
 
 
1172
 
 
1173
<li class="method" id="method-remove">
 
1174
  <div class="method-header">
 
1175
    <h3 class="method-name"><a href="#method-remove">remove</a></h3>
 
1176
    <dl>
 
1177
      <dt class="method-signature-label">Signature:</dt>
 
1178
        <dd class="method-signature">.tabs( 'remove'
 
1179
 
 
1180
, index
 
1181
 
 
1182
 
 
1183
 
 
1184
 
 
1185
 
 
1186
)</dd>
 
1187
    </dl>
 
1188
  </div>
 
1189
  <div class="method-description">
 
1190
    <p>Remove a tab. The second argument is the zero-based index of the tab to be removed.</p>
 
1191
  </div>
 
1192
</li>
 
1193
 
 
1194
 
 
1195
<li class="method" id="method-enable">
 
1196
  <div class="method-header">
 
1197
    <h3 class="method-name"><a href="#method-enable">enable</a></h3>
 
1198
    <dl>
 
1199
      <dt class="method-signature-label">Signature:</dt>
 
1200
        <dd class="method-signature">.tabs( 'enable'
 
1201
 
 
1202
, index
 
1203
 
 
1204
 
 
1205
 
 
1206
 
 
1207
 
 
1208
)</dd>
 
1209
    </dl>
 
1210
  </div>
 
1211
  <div class="method-description">
 
1212
    <p>Enable a disabled tab.  To enable more than one tab at once reset the disabled property like: <code>$('#example').data('disabled.tabs', []);</code>. The second argument is the zero-based index of the tab to be enabled.</p>
 
1213
  </div>
 
1214
</li>
 
1215
 
 
1216
 
 
1217
<li class="method" id="method-disable">
 
1218
  <div class="method-header">
 
1219
    <h3 class="method-name"><a href="#method-disable">disable</a></h3>
 
1220
    <dl>
 
1221
      <dt class="method-signature-label">Signature:</dt>
 
1222
        <dd class="method-signature">.tabs( 'disable'
 
1223
 
 
1224
, index
 
1225
 
 
1226
 
 
1227
 
 
1228
 
 
1229
 
 
1230
)</dd>
 
1231
    </dl>
 
1232
  </div>
 
1233
  <div class="method-description">
 
1234
    <p>Disable a tab. The selected tab cannot be disabled. To disable more than one tab at once use: <code>$('#example').data('disabled.tabs', [1, 2, 3]);</code>  The second argument is the zero-based index of the tab to be disabled.</p>
 
1235
  </div>
 
1236
</li>
 
1237
 
 
1238
 
 
1239
<li class="method" id="method-select">
 
1240
  <div class="method-header">
 
1241
    <h3 class="method-name"><a href="#method-select">select</a></h3>
 
1242
    <dl>
 
1243
      <dt class="method-signature-label">Signature:</dt>
 
1244
        <dd class="method-signature">.tabs( 'select'
 
1245
 
 
1246
, index
 
1247
 
 
1248
 
 
1249
 
 
1250
 
 
1251
 
 
1252
)</dd>
 
1253
    </dl>
 
1254
  </div>
 
1255
  <div class="method-description">
 
1256
    <p>Select a tab, as if it were clicked. The second argument is the zero-based index of the tab to be selected or the id selector of the panel the tab is associated with (the tab's href fragment identifier, e.g. hash, points to the panel's id).</p>
 
1257
  </div>
 
1258
</li>
 
1259
 
 
1260
 
 
1261
<li class="method" id="method-load">
 
1262
  <div class="method-header">
 
1263
    <h3 class="method-name"><a href="#method-load">load</a></h3>
 
1264
    <dl>
 
1265
      <dt class="method-signature-label">Signature:</dt>
 
1266
        <dd class="method-signature">.tabs( 'load'
 
1267
 
 
1268
, index
 
1269
 
 
1270
 
 
1271
 
 
1272
 
 
1273
 
 
1274
)</dd>
 
1275
    </dl>
 
1276
  </div>
 
1277
  <div class="method-description">
 
1278
    <p>Reload the content of an Ajax tab programmatically. This method always loads the tab content from the remote location, even if cache is set to true. The second argument is the zero-based index of the tab to be reloaded.</p>
 
1279
  </div>
 
1280
</li>
 
1281
 
 
1282
 
 
1283
<li class="method" id="method-url">
 
1284
  <div class="method-header">
 
1285
    <h3 class="method-name"><a href="#method-url">url</a></h3>
 
1286
    <dl>
 
1287
      <dt class="method-signature-label">Signature:</dt>
 
1288
        <dd class="method-signature">.tabs( 'url'
 
1289
 
 
1290
, index
 
1291
 
 
1292
, url
 
1293
 
 
1294
 
 
1295
 
 
1296
)</dd>
 
1297
    </dl>
 
1298
  </div>
 
1299
  <div class="method-description">
 
1300
    <p>Change the url from which an Ajax (remote) tab will be loaded. The specified URL will be used for subsequent loads. Note that you can not only change the URL for an existing remote tab with this method, but also turn an in-page tab into a remote tab.  The second argument is the zero-based index of the tab of which its URL is to be updated.  The third is a URL the content of the tab is loaded from.</p>
 
1301
  </div>
 
1302
</li>
 
1303
 
 
1304
 
 
1305
<li class="method" id="method-length">
 
1306
  <div class="method-header">
 
1307
    <h3 class="method-name"><a href="#method-length">length</a></h3>
 
1308
    <dl>
 
1309
      <dt class="method-signature-label">Signature:</dt>
 
1310
        <dd class="method-signature">.tabs( 'length'
 
1311
 
 
1312
 
 
1313
 
 
1314
 
 
1315
 
 
1316
 
 
1317
 
 
1318
)</dd>
 
1319
    </dl>
 
1320
  </div>
 
1321
  <div class="method-description">
 
1322
    <p>Retrieve the number of tabs of the first matched tab pane.</p>
 
1323
  </div>
 
1324
</li>
 
1325
 
 
1326
 
 
1327
<li class="method" id="method-abort">
 
1328
  <div class="method-header">
 
1329
    <h3 class="method-name"><a href="#method-abort">abort</a></h3>
 
1330
    <dl>
 
1331
      <dt class="method-signature-label">Signature:</dt>
 
1332
        <dd class="method-signature">.tabs( 'abort'
 
1333
 
 
1334
 
 
1335
 
 
1336
 
 
1337
 
 
1338
 
 
1339
 
 
1340
)</dd>
 
1341
    </dl>
 
1342
  </div>
 
1343
  <div class="method-description">
 
1344
    <p>Terminate all running tab ajax requests and animations.</p>
 
1345
  </div>
 
1346
</li>
 
1347
 
 
1348
 
 
1349
<li class="method" id="method-rotate">
 
1350
  <div class="method-header">
 
1351
    <h3 class="method-name"><a href="#method-rotate">rotate</a></h3>
 
1352
    <dl>
 
1353
      <dt class="method-signature-label">Signature:</dt>
 
1354
        <dd class="method-signature">.tabs( 'rotate'
 
1355
 
 
1356
, ms
 
1357
 
 
1358
, <span class="optional">[</span>continuing<span class="optional">] </span>
 
1359
 
 
1360
 
 
1361
 
 
1362
)</dd>
 
1363
    </dl>
 
1364
  </div>
 
1365
  <div class="method-description">
 
1366
    <p>Set up an automatic rotation through tabs of a tab pane.  The second argument is an amount of time in milliseconds until the next tab in the cycle gets activated. Use 0 or null to stop the rotation.  The third controls whether or not to continue the rotation after a tab has been selected by a user. Default: false.</p>
 
1367
  </div>
 
1368
</li>
 
1369
 
 
1370
    </ul>
 
1371
  </div>
 
1372
  <div id="theming">
 
1373
    <h2 class="top-header">Theming</h2>
 
1374
    <p>The jQuery UI Tabs 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.
 
1375
</p>
 
1376
  <p>If a deeper level of customization is needed, there are widget-specific classes referenced within the ui.tabs.css stylesheet that can be modified. These classes are highlighed in bold below.
 
1377
</p>
 
1378
    
 
1379
  <h3>Sample markup with jQuery UI CSS Framework classes</h3>
 
1380
  &lt;div class=&quot;<strong>ui-tabs</strong> ui-widget ui-widget-content ui-corner-all&quot; id=&quot;tabs&quot;&gt;<br />
 
1381
&nbsp;&nbsp;&nbsp;&lt;ul class=&quot;<strong>ui-tabs-nav</strong> ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all&quot;&gt;<br />
 
1382
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li class=&quot;ui-state-default ui-corner-top ui-tabs-selected ui-state-active&quot;&gt;&lt;a href=&quot;#tabs-1&quot;&gt;Nunc tincidunt&lt;/a&gt;&lt;/li&gt;<br />
 
1383
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li class=&quot;ui-state-default ui-corner-top&quot;&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Proin dolor&lt;/a&gt;&lt;/li&gt;<br />
 
1384
&nbsp;&nbsp;&nbsp;&lt;div class=&quot;<strong>ui-tabs-panel</strong> ui-widget-content ui-corner-bottom&quot; id=&quot;tabs-1&quot;&gt;<br />
 
1385
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Tab one content goes here.&lt;/p&gt;<br />
 
1386
&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
 
1387
&nbsp;&nbsp;&nbsp; ...<br />
 
1388
&lt;/div&gt;<br />
 
1389
  <p class="theme-note">
 
1390
    <strong>
 
1391
      Note: This is a sample of markup generated by the tabs plugin, not markup you should use to create a tabs. The only markup needed for that is <br />&lt;div id=&quot;tabs&quot;&gt;<br />
 
1392
&#160;&#160;&#160;&lt;ul&gt;<br />
 
1393
&#160;&#160;&#160;&#160;&#160;&#160;&lt;li&gt;&lt;a href=&quot;#tabs-1&quot;&gt;Nunc tincidunt&lt;/a&gt;&lt;/li&gt;<br />
 
1394
&#160;&#160;&#160;&#160;&#160;&#160;&lt;li&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Proin dolor&lt;/a&gt;&lt;/li&gt;<br />
 
1395
&#160;&#160;&#160;&#160;&#160;&#160;&lt;li&gt;&lt;a href=&quot;#tabs-3&quot;&gt;Aenean lacinia&lt;/a&gt;&lt;/li&gt;<br />
 
1396
&#160;&#160;&#160;&lt;/ul&gt;<br />
 
1397
&#160;&#160;&#160;&lt;div id=&quot;tabs-1&quot;&gt;<br />
 
1398
&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 1 content&lt;/p&gt;<br />
 
1399
&#160;&#160;&#160;&lt;/div&gt;<br />
 
1400
&#160;&#160;&#160;&lt;div id=&quot;tabs-2&quot;&gt;<br />
 
1401
&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 2 content&lt;/p&gt;<br />
 
1402
&#160;&#160;&#160;&lt;/div&gt;<br />
 
1403
&#160;&#160;&#160;&lt;div id=&quot;tabs-3&quot;&gt;<br />
 
1404
&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 3 content&lt;/p&gt;<br />
 
1405
&#160;&#160;&#160;&lt;/div&gt;<br />
 
1406
&lt;/div&gt;.
 
1407
    </strong>
 
1408
  </p>
 
1409
 
 
1410
  </div>
 
1411
</div>
 
1412
 
 
1413
</p><!-- 
 
1414
Pre-expand include size: 51589 bytes
 
1415
Post-expand include size: 90199 bytes
 
1416
Template argument size: 55853 bytes
 
1417
Maximum: 2097152 bytes
 
1418
-->
 
1419
 
 
1420
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3184-1!1!0!!en!2 and timestamp 20090319021844 -->