source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/docs/tabs.html@ 24245

Last change on this file since 24245 was 24245, checked in by sjb48, 13 years ago

Oran code for supporting format changes to document.

  • Property svn:executable set to *
File size: 46.9 KB
Line 
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="#...follow_a_tab.27s_URL_instead_of_loading_its_content_via_ajax"><span class="tocnumber">3.6</span> <span class="toctext">...follow a tab's URL instead of loading its content via ajax</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
76could 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
88a 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();
96var 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="...follow_a_tab.27s_URL_instead_of_loading_its_content_via_ajax"></a><h3>...follow a tab's URL instead of loading its content via ajax</h3>
131<p>Note that opening a tab in a new window is unexpected, e.g.
132inconsistent 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 var url = $.data(ui.tab, 'load.tabs');
137 if( url ) {
138 location.href = url;
139 return false;
140 }
141 return true;
142 }
143});</pre>
144<p><br />
145</p>
146<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>
147<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:
148</p>
149<pre>&lt;div id=&quot;example&quot; class=&quot;ui-tabs&quot;&gt;
150 ...
151 &lt;div id=&quot;a-tab-panel&quot; class=&quot;ui-tabs-hide&quot;&gt; &lt;/div&gt;
152 ...
153&lt;/div&gt;</pre>
154<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>
155<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>
156<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).
157</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
158</p>
159<pre>.ui-tabs .ui-tabs-hide {
160 position: absolute;
161 left: -10000px;
162}</pre>
163<p>For Google maps you can also resize the map once the tab is displayed like this:
164</p>
165<pre>$('#example').bind('tabsshow', function(event, ui) {
166 if (ui.panel.id == &quot;map-tab&quot;) {
167 resizeMap();
168 }
169});</pre>
170resizeMap() will call Google Maps' checkResize() on the particular map.
171 </div>
172 <div id="overview-dependencies">
173 <h3>Dependencies</h3>
174 <ul>
175<li>UI Core</li>
176<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>
177<li>Required CSS:
178<pre>.ui-tabs .ui-tabs-hide {
179 display: none;
180}</pre></li>
181</ul>
182 </div>
183 <div id="overview-example">
184 <h3>Example</h3>
185 <div id="overview-example" class="example">
186<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
187<p><div id="demo" class="tabs-container" rel="295">
188A simple jQuery UI Tabs.<br />
189</p>
190<pre>$(&quot;#tabs&quot;).tabs();
191</pre>
192<p></div><div id="source" class="tabs-container">
193</p>
194<pre>&lt;!DOCTYPE html&gt;
195&lt;html&gt;
196&lt;head&gt;
197 &lt;link type=&quot;text/css&quot; href=&quot;http://jqueryui.com/latest/themes/base/ui.all.css&quot; rel=&quot;stylesheet&quot; /&gt;
198 &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/jquery-1.3.2.js&quot;&gt;&lt;/script&gt;
199 &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.core.js&quot;&gt;&lt;/script&gt;
200 &lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryui.com/latest/ui/ui.tabs.js&quot;&gt;&lt;/script&gt;
201 &lt;script type="text/javascript"&gt;
202 $(document).ready(function(){
203 $(&quot;#tabs&quot;).tabs();
204 });
205 &lt;/script&gt;
206&lt;/head&gt;
207&lt;body style="font-size:62.5%;"&gt;
208
209&lt;div id=&quot;tabs&quot;&gt;
210 &lt;ul&gt;
211 &lt;li&gt;&lt;a href=&quot;#fragment-1&quot;&gt;&lt;span&gt;One&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
212 &lt;li&gt;&lt;a href=&quot;#fragment-2&quot;&gt;&lt;span&gt;Two&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
213 &lt;li&gt;&lt;a href=&quot;#fragment-3&quot;&gt;&lt;span&gt;Three&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
214 &lt;/ul&gt;
215 &lt;div id=&quot;fragment-1&quot;&gt;
216 &lt;p&gt;First tab is active by default:&lt;/p&gt;
217 &lt;pre&gt;&lt;code&gt;$('#example').tabs();&lt;/code&gt;&lt;/pre&gt;
218 &lt;/div&gt;
219 &lt;div id=&quot;fragment-2&quot;&gt;
220 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
221 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
222 &lt;/div&gt;
223 &lt;div id=&quot;fragment-3&quot;&gt;
224 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
225 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
226 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
227 &lt;/div&gt;
228&lt;/div&gt;
229&lt;/body&gt;
230&lt;/html&gt;
231</pre>
232<p></div>
233</p><p></div>
234 </div>
235 </div>
236 <div id="options">
237 <h2 class="top-header">Options</h2>
238 <ul class="options-list">
239
240<li class="option" id="option-ajaxOptions">
241 <div class="option-header">
242 <h3 class="option-name"><a href="#option-ajaxOptions">ajaxOptions</a></h3>
243 <dl>
244 <dt class="option-type-label">Type:</dt>
245 <dd class="option-type">Options</dd>
246
247 <dt class="option-default-label">Default:</dt>
248 <dd class="option-default">null</dd>
249
250 </dl>
251 </div>
252 <div class="option-description">
253 <p>Additional Ajax options to consider when loading tab content (see $.ajax).</p>
254 </div>
255 <div class="option-examples">
256 <h4>Code examples</h4>
257 <dl class="option-examples-list">
258
259<dt>
260 Initialize a tabs with the <code>ajaxOptions</code> option specified.
261</dt>
262<dd>
263<pre><code>$('.selector').tabs({ ajaxOptions: { async: false } });</code></pre>
264</dd>
265
266
267<dt>
268 Get or set the <code>ajaxOptions</code> option, after init.
269</dt>
270<dd>
271<pre><code>//getter
272var ajaxOptions = $('.selector').tabs('option', 'ajaxOptions');
273//setter
274$('.selector').tabs('option', 'ajaxOptions', { async: false });</code></pre>
275</dd>
276
277 </dl>
278 </div>
279</li>
280
281
282<li class="option" id="option-cache">
283 <div class="option-header">
284 <h3 class="option-name"><a href="#option-cache">cache</a></h3>
285 <dl>
286 <dt class="option-type-label">Type:</dt>
287 <dd class="option-type">Boolean</dd>
288
289 <dt class="option-default-label">Default:</dt>
290 <dd class="option-default">false</dd>
291
292 </dl>
293 </div>
294 <div class="option-description">
295 <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>
296 </div>
297 <div class="option-examples">
298 <h4>Code examples</h4>
299 <dl class="option-examples-list">
300
301<dt>
302 Initialize a tabs with the <code>cache</code> option specified.
303</dt>
304<dd>
305<pre><code>$('.selector').tabs({ cache: true });</code></pre>
306</dd>
307
308
309<dt>
310 Get or set the <code>cache</code> option, after init.
311</dt>
312<dd>
313<pre><code>//getter
314var cache = $('.selector').tabs('option', 'cache');
315//setter
316$('.selector').tabs('option', 'cache', true);</code></pre>
317</dd>
318
319 </dl>
320 </div>
321</li>
322
323
324<li class="option" id="option-collapsible">
325 <div class="option-header">
326 <h3 class="option-name"><a href="#option-collapsible">collapsible</a></h3>
327 <dl>
328 <dt class="option-type-label">Type:</dt>
329 <dd class="option-type">Boolean</dd>
330
331 <dt class="option-default-label">Default:</dt>
332 <dd class="option-default">false</dd>
333
334 </dl>
335 </div>
336 <div class="option-description">
337 <p>Set to true to allow an already selected tab to become unselected again upon reselection.</p>
338 </div>
339 <div class="option-examples">
340 <h4>Code examples</h4>
341 <dl class="option-examples-list">
342
343<dt>
344 Initialize a tabs with the <code>collapsible</code> option specified.
345</dt>
346<dd>
347<pre><code>$('.selector').tabs({ collapsible: true });</code></pre>
348</dd>
349
350
351<dt>
352 Get or set the <code>collapsible</code> option, after init.
353</dt>
354<dd>
355<pre><code>//getter
356var collapsible = $('.selector').tabs('option', 'collapsible');
357//setter
358$('.selector').tabs('option', 'collapsible', true);</code></pre>
359</dd>
360
361 </dl>
362 </div>
363</li>
364
365
366<li class="option" id="option-cookie">
367 <div class="option-header">
368 <h3 class="option-name"><a href="#option-cookie">cookie</a></h3>
369 <dl>
370 <dt class="option-type-label">Type:</dt>
371 <dd class="option-type">Object</dd>
372
373 <dt class="option-default-label">Default:</dt>
374 <dd class="option-default">null</dd>
375
376 </dl>
377 </div>
378 <div class="option-description">
379 <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>
380 </div>
381 <div class="option-examples">
382 <h4>Code examples</h4>
383 <dl class="option-examples-list">
384
385<dt>
386 Initialize a tabs with the <code>cookie</code> option specified.
387</dt>
388<dd>
389<pre><code>$('.selector').tabs({ cookie: { expires: 30 } });</code></pre>
390</dd>
391
392
393<dt>
394 Get or set the <code>cookie</code> option, after init.
395</dt>
396<dd>
397<pre><code>//getter
398var cookie = $('.selector').tabs('option', 'cookie');
399//setter
400$('.selector').tabs('option', 'cookie', { expires: 30 });</code></pre>
401</dd>
402
403 </dl>
404 </div>
405</li>
406
407
408<li class="option" id="option-deselectable">
409 <div class="option-header">
410 <h3 class="option-name"><a href="#option-deselectable">deselectable</a></h3>
411 <dl>
412 <dt class="option-type-label">Type:</dt>
413 <dd class="option-type">Boolean</dd>
414
415 <dt class="option-default-label">Default:</dt>
416 <dd class="option-default">false</dd>
417
418 </dl>
419 </div>
420 <div class="option-description">
421 <p>deprecated in jQuery UI 1.7, use collapsible.</p>
422 </div>
423 <div class="option-examples">
424 <h4>Code examples</h4>
425 <dl class="option-examples-list">
426
427<dt>
428 Initialize a tabs with the <code>deselectable</code> option specified.
429</dt>
430<dd>
431<pre><code>$('.selector').tabs({ deselectable: true });</code></pre>
432</dd>
433
434
435<dt>
436 Get or set the <code>deselectable</code> option, after init.
437</dt>
438<dd>
439<pre><code>//getter
440var deselectable = $('.selector').tabs('option', 'deselectable');
441//setter
442$('.selector').tabs('option', 'deselectable', true);</code></pre>
443</dd>
444
445 </dl>
446 </div>
447</li>
448
449
450<li class="option" id="option-disabled">
451 <div class="option-header">
452 <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
453 <dl>
454 <dt class="option-type-label">Type:</dt>
455 <dd class="option-type">Array&lt;Number&gt;</dd>
456
457 <dt class="option-default-label">Default:</dt>
458 <dd class="option-default">[]</dd>
459
460 </dl>
461 </div>
462 <div class="option-description">
463 <p>An array containing the position of the tabs (zero-based index) that should be disabled on initialization.</p>
464 </div>
465 <div class="option-examples">
466 <h4>Code examples</h4>
467 <dl class="option-examples-list">
468
469<dt>
470 Initialize a tabs with the <code>disabled</code> option specified.
471</dt>
472<dd>
473<pre><code>$('.selector').tabs({ disabled: [1, 2] });</code></pre>
474</dd>
475
476
477<dt>
478 Get or set the <code>disabled</code> option, after init.
479</dt>
480<dd>
481<pre><code>//getter
482var disabled = $('.selector').tabs('option', 'disabled');
483//setter
484$('.selector').tabs('option', 'disabled', [1, 2]);</code></pre>
485</dd>
486
487 </dl>
488 </div>
489</li>
490
491
492<li class="option" id="option-event">
493 <div class="option-header">
494 <h3 class="option-name"><a href="#option-event">event</a></h3>
495 <dl>
496 <dt class="option-type-label">Type:</dt>
497 <dd class="option-type">String</dd>
498
499 <dt class="option-default-label">Default:</dt>
500 <dd class="option-default">'click'</dd>
501
502 </dl>
503 </div>
504 <div class="option-description">
505 <p>The type of event to be used for selecting a tab.</p>
506 </div>
507 <div class="option-examples">
508 <h4>Code examples</h4>
509 <dl class="option-examples-list">
510
511<dt>
512 Initialize a tabs with the <code>event</code> option specified.
513</dt>
514<dd>
515<pre><code>$('.selector').tabs({ event: 'mouseover' });</code></pre>
516</dd>
517
518
519<dt>
520 Get or set the <code>event</code> option, after init.
521</dt>
522<dd>
523<pre><code>//getter
524var event = $('.selector').tabs('option', 'event');
525//setter
526$('.selector').tabs('option', 'event', 'mouseover');</code></pre>
527</dd>
528
529 </dl>
530 </div>
531</li>
532
533
534<li class="option" id="option-fx">
535 <div class="option-header">
536 <h3 class="option-name"><a href="#option-fx">fx</a></h3>
537 <dl>
538 <dt class="option-type-label">Type:</dt>
539 <dd class="option-type">Options, Array&lt;Options&gt;</dd>
540
541 <dt class="option-default-label">Default:</dt>
542 <dd class="option-default">null</dd>
543
544 </dl>
545 </div>
546 <div class="option-description">
547 <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>
548 </div>
549 <div class="option-examples">
550 <h4>Code examples</h4>
551 <dl class="option-examples-list">
552
553<dt>
554 Initialize a tabs with the <code>fx</code> option specified.
555</dt>
556<dd>
557<pre><code>$('.selector').tabs({ fx: { opacity: 'toggle' } });</code></pre>
558</dd>
559
560
561<dt>
562 Get or set the <code>fx</code> option, after init.
563</dt>
564<dd>
565<pre><code>//getter
566var fx = $('.selector').tabs('option', 'fx');
567//setter
568$('.selector').tabs('option', 'fx', { opacity: 'toggle' });</code></pre>
569</dd>
570
571 </dl>
572 </div>
573</li>
574
575
576<li class="option" id="option-idPrefix">
577 <div class="option-header">
578 <h3 class="option-name"><a href="#option-idPrefix">idPrefix</a></h3>
579 <dl>
580 <dt class="option-type-label">Type:</dt>
581 <dd class="option-type">String</dd>
582
583 <dt class="option-default-label">Default:</dt>
584 <dd class="option-default">'ui-tabs-'</dd>
585
586 </dl>
587 </div>
588 <div class="option-description">
589 <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>
590 </div>
591 <div class="option-examples">
592 <h4>Code examples</h4>
593 <dl class="option-examples-list">
594
595<dt>
596 Initialize a tabs with the <code>idPrefix</code> option specified.
597</dt>
598<dd>
599<pre><code>$('.selector').tabs({ idPrefix: 'ui-tabs-primary' });</code></pre>
600</dd>
601
602
603<dt>
604 Get or set the <code>idPrefix</code> option, after init.
605</dt>
606<dd>
607<pre><code>//getter
608var idPrefix = $('.selector').tabs('option', 'idPrefix');
609//setter
610$('.selector').tabs('option', 'idPrefix', 'ui-tabs-primary');</code></pre>
611</dd>
612
613 </dl>
614 </div>
615</li>
616
617
618<li class="option" id="option-panelTemplate">
619 <div class="option-header">
620 <h3 class="option-name"><a href="#option-panelTemplate">panelTemplate</a></h3>
621 <dl>
622 <dt class="option-type-label">Type:</dt>
623 <dd class="option-type">String</dd>
624
625 <dt class="option-default-label">Default:</dt>
626 <dd class="option-default">'&lt;div&gt;&lt;/div&gt;'</dd>
627
628 </dl>
629 </div>
630 <div class="option-description">
631 <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>
632 </div>
633 <div class="option-examples">
634 <h4>Code examples</h4>
635 <dl class="option-examples-list">
636
637<dt>
638 Initialize a tabs with the <code>panelTemplate</code> option specified.
639</dt>
640<dd>
641<pre><code>$('.selector').tabs({ panelTemplate: '&lt;li&gt;&lt;/li&gt;' });</code></pre>
642</dd>
643
644
645<dt>
646 Get or set the <code>panelTemplate</code> option, after init.
647</dt>
648<dd>
649<pre><code>//getter
650var panelTemplate = $('.selector').tabs('option', 'panelTemplate');
651//setter
652$('.selector').tabs('option', 'panelTemplate', '&lt;li&gt;&lt;/li&gt;');</code></pre>
653</dd>
654
655 </dl>
656 </div>
657</li>
658
659
660<li class="option" id="option-selected">
661 <div class="option-header">
662 <h3 class="option-name"><a href="#option-selected">selected</a></h3>
663 <dl>
664 <dt class="option-type-label">Type:</dt>
665 <dd class="option-type">Number</dd>
666
667 <dt class="option-default-label">Default:</dt>
668 <dd class="option-default">0</dd>
669
670 </dl>
671 </div>
672 <div class="option-description">
673 <p>Zero-based index of the tab to be selected on initialization. To set all tabs to unselected pass -1 as value.</p>
674 </div>
675 <div class="option-examples">
676 <h4>Code examples</h4>
677 <dl class="option-examples-list">
678
679<dt>
680 Initialize a tabs with the <code>selected</code> option specified.
681</dt>
682<dd>
683<pre><code>$('.selector').tabs({ selected: 3 });</code></pre>
684</dd>
685
686
687<dt>
688 Get or set the <code>selected</code> option, after init.
689</dt>
690<dd>
691<pre><code>//getter
692var selected = $('.selector').tabs('option', 'selected');
693//setter
694$('.selector').tabs('option', 'selected', 3);</code></pre>
695</dd>
696
697 </dl>
698 </div>
699</li>
700
701
702<li class="option" id="option-spinner">
703 <div class="option-header">
704 <h3 class="option-name"><a href="#option-spinner">spinner</a></h3>
705 <dl>
706 <dt class="option-type-label">Type:</dt>
707 <dd class="option-type">String</dd>
708
709 <dt class="option-default-label">Default:</dt>
710 <dd class="option-default">'&lt;em&gt;Loading&amp;#8230;&lt;/em&gt;'</dd>
711
712 </dl>
713 </div>
714 <div class="option-description">
715 <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>
716 </div>
717 <div class="option-examples">
718 <h4>Code examples</h4>
719 <dl class="option-examples-list">
720
721<dt>
722 Initialize a tabs with the <code>spinner</code> option specified.
723</dt>
724<dd>
725<pre><code>$('.selector').tabs({ spinner: 'Retrieving data...' });</code></pre>
726</dd>
727
728
729<dt>
730 Get or set the <code>spinner</code> option, after init.
731</dt>
732<dd>
733<pre><code>//getter
734var spinner = $('.selector').tabs('option', 'spinner');
735//setter
736$('.selector').tabs('option', 'spinner', 'Retrieving data...');</code></pre>
737</dd>
738
739 </dl>
740 </div>
741</li>
742
743
744<li class="option" id="option-tabTemplate">
745 <div class="option-header">
746 <h3 class="option-name"><a href="#option-tabTemplate">tabTemplate</a></h3>
747 <dl>
748 <dt class="option-type-label">Type:</dt>
749 <dd class="option-type">String</dd>
750
751 <dt class="option-default-label">Default:</dt>
752 <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>
753
754 </dl>
755 </div>
756 <div class="option-description">
757 <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>
758 </div>
759 <div class="option-examples">
760 <h4>Code examples</h4>
761 <dl class="option-examples-list">
762
763<dt>
764 Initialize a tabs with the <code>tabTemplate</code> option specified.
765</dt>
766<dd>
767<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>
768</dd>
769
770
771<dt>
772 Get or set the <code>tabTemplate</code> option, after init.
773</dt>
774<dd>
775<pre><code>//getter
776var tabTemplate = $('.selector').tabs('option', 'tabTemplate');
777//setter
778$('.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>
779</dd>
780
781 </dl>
782 </div>
783</li>
784
785 </ul>
786 </div>
787 <div id="events">
788 <h2 class="top-header">Events</h2>
789 <ul class="events-list">
790
791<li class="event" id="event-select">
792 <div class="event-header">
793 <h3 class="event-name"><a href="#event-select">select</a></h3>
794 <dl>
795 <dt class="event-type-label">Type:</dt>
796 <dd class="event-type">tabsselect</dd>
797 </dl>
798 </div>
799 <div class="event-description">
800 <p>This event is triggered when clicking a tab.</p>
801 </div>
802 <div class="event-examples">
803 <h4>Code examples</h4>
804 <dl class="event-examples-list">
805
806<dt>
807 Supply a callback function to handle the <code>select</code> event as an init option.
808</dt>
809<dd>
810<pre><code>$('.selector').tabs({
811 select: function(event, ui) { ... }
812});</code></pre>
813</dd>
814
815
816<dt>
817 Bind to the <code>select</code> event by type: <code>tabsselect</code>.
818</dt>
819<dd>
820<pre><code>$('.selector').bind('tabsselect', function(event, ui) {
821 ...
822});</code></pre>
823</dd>
824
825 </dl>
826 </div>
827</li>
828
829
830<li class="event" id="event-load">
831 <div class="event-header">
832 <h3 class="event-name"><a href="#event-load">load</a></h3>
833 <dl>
834 <dt class="event-type-label">Type:</dt>
835 <dd class="event-type">tabsload</dd>
836 </dl>
837 </div>
838 <div class="event-description">
839 <p>This event is triggered after the content of a remote tab has been loaded.</p>
840 </div>
841 <div class="event-examples">
842 <h4>Code examples</h4>
843 <dl class="event-examples-list">
844
845<dt>
846 Supply a callback function to handle the <code>load</code> event as an init option.
847</dt>
848<dd>
849<pre><code>$('.selector').tabs({
850 load: function(event, ui) { ... }
851});</code></pre>
852</dd>
853
854
855<dt>
856 Bind to the <code>load</code> event by type: <code>tabsload</code>.
857</dt>
858<dd>
859<pre><code>$('.selector').bind('tabsload', function(event, ui) {
860 ...
861});</code></pre>
862</dd>
863
864 </dl>
865 </div>
866</li>
867
868
869<li class="event" id="event-show">
870 <div class="event-header">
871 <h3 class="event-name"><a href="#event-show">show</a></h3>
872 <dl>
873 <dt class="event-type-label">Type:</dt>
874 <dd class="event-type">tabsshow</dd>
875 </dl>
876 </div>
877 <div class="event-description">
878 <p>This event is triggered when a tab is shown.</p>
879 </div>
880 <div class="event-examples">
881 <h4>Code examples</h4>
882 <dl class="event-examples-list">
883
884<dt>
885 Supply a callback function to handle the <code>show</code> event as an init option.
886</dt>
887<dd>
888<pre><code>$('.selector').tabs({
889 show: function(event, ui) { ... }
890});</code></pre>
891</dd>
892
893
894<dt>
895 Bind to the <code>show</code> event by type: <code>tabsshow</code>.
896</dt>
897<dd>
898<pre><code>$('.selector').bind('tabsshow', function(event, ui) {
899 ...
900});</code></pre>
901</dd>
902
903 </dl>
904 </div>
905</li>
906
907
908<li class="event" id="event-add">
909 <div class="event-header">
910 <h3 class="event-name"><a href="#event-add">add</a></h3>
911 <dl>
912 <dt class="event-type-label">Type:</dt>
913 <dd class="event-type">tabsadd</dd>
914 </dl>
915 </div>
916 <div class="event-description">
917 <p>This event is triggered when a tab is added.</p>
918 </div>
919 <div class="event-examples">
920 <h4>Code examples</h4>
921 <dl class="event-examples-list">
922
923<dt>
924 Supply a callback function to handle the <code>add</code> event as an init option.
925</dt>
926<dd>
927<pre><code>$('.selector').tabs({
928 add: function(event, ui) { ... }
929});</code></pre>
930</dd>
931
932
933<dt>
934 Bind to the <code>add</code> event by type: <code>tabsadd</code>.
935</dt>
936<dd>
937<pre><code>$('.selector').bind('tabsadd', function(event, ui) {
938 ...
939});</code></pre>
940</dd>
941
942 </dl>
943 </div>
944</li>
945
946
947<li class="event" id="event-remove">
948 <div class="event-header">
949 <h3 class="event-name"><a href="#event-remove">remove</a></h3>
950 <dl>
951 <dt class="event-type-label">Type:</dt>
952 <dd class="event-type">tabsremove</dd>
953 </dl>
954 </div>
955 <div class="event-description">
956 <p>This event is triggered when a tab is removed.</p>
957 </div>
958 <div class="event-examples">
959 <h4>Code examples</h4>
960 <dl class="event-examples-list">
961
962<dt>
963 Supply a callback function to handle the <code>remove</code> event as an init option.
964</dt>
965<dd>
966<pre><code>$('.selector').tabs({
967 remove: function(event, ui) { ... }
968});</code></pre>
969</dd>
970
971
972<dt>
973 Bind to the <code>remove</code> event by type: <code>tabsremove</code>.
974</dt>
975<dd>
976<pre><code>$('.selector').bind('tabsremove', function(event, ui) {
977 ...
978});</code></pre>
979</dd>
980
981 </dl>
982 </div>
983</li>
984
985
986<li class="event" id="event-enable">
987 <div class="event-header">
988 <h3 class="event-name"><a href="#event-enable">enable</a></h3>
989 <dl>
990 <dt class="event-type-label">Type:</dt>
991 <dd class="event-type">tabsenable</dd>
992 </dl>
993 </div>
994 <div class="event-description">
995 <p>This event is triggered when a tab is enabled.</p>
996 </div>
997 <div class="event-examples">
998 <h4>Code examples</h4>
999 <dl class="event-examples-list">
1000
1001<dt>
1002 Supply a callback function to handle the <code>enable</code> event as an init option.
1003</dt>
1004<dd>
1005<pre><code>$('.selector').tabs({
1006 enable: function(event, ui) { ... }
1007});</code></pre>
1008</dd>
1009
1010
1011<dt>
1012 Bind to the <code>enable</code> event by type: <code>tabsenable</code>.
1013</dt>
1014<dd>
1015<pre><code>$('.selector').bind('tabsenable', function(event, ui) {
1016 ...
1017});</code></pre>
1018</dd>
1019
1020 </dl>
1021 </div>
1022</li>
1023
1024
1025<li class="event" id="event-disable">
1026 <div class="event-header">
1027 <h3 class="event-name"><a href="#event-disable">disable</a></h3>
1028 <dl>
1029 <dt class="event-type-label">Type:</dt>
1030 <dd class="event-type">tabsdisable</dd>
1031 </dl>
1032 </div>
1033 <div class="event-description">
1034 <p>This event is triggered when a tab is disabled.</p>
1035 </div>
1036 <div class="event-examples">
1037 <h4>Code examples</h4>
1038 <dl class="event-examples-list">
1039
1040<dt>
1041 Supply a callback function to handle the <code>disable</code> event as an init option.
1042</dt>
1043<dd>
1044<pre><code>$('.selector').tabs({
1045 disable: function(event, ui) { ... }
1046});</code></pre>
1047</dd>
1048
1049
1050<dt>
1051 Bind to the <code>disable</code> event by type: <code>tabsdisable</code>.
1052</dt>
1053<dd>
1054<pre><code>$('.selector').bind('tabsdisable', function(event, ui) {
1055 ...
1056});</code></pre>
1057</dd>
1058
1059 </dl>
1060 </div>
1061</li>
1062
1063 </ul>
1064 </div>
1065 <div id="methods">
1066 <h2 class="top-header">Methods</h2>
1067 <ul class="methods-list">
1068
1069<li class="method" id="method-destroy">
1070 <div class="method-header">
1071 <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
1072 <dl>
1073 <dt class="method-signature-label">Signature:</dt>
1074 <dd class="method-signature">.tabs( 'destroy'
1075
1076
1077
1078
1079
1080
1081
1082)</dd>
1083 </dl>
1084 </div>
1085 <div class="method-description">
1086 <p>Remove the tabs functionality completely. This will return the element back to its pre-init state.</p>
1087 </div>
1088</li>
1089
1090
1091<li class="method" id="method-disable">
1092 <div class="method-header">
1093 <h3 class="method-name"><a href="#method-disable">disable</a></h3>
1094 <dl>
1095 <dt class="method-signature-label">Signature:</dt>
1096 <dd class="method-signature">.tabs( 'disable'
1097
1098
1099
1100
1101
1102
1103
1104)</dd>
1105 </dl>
1106 </div>
1107 <div class="method-description">
1108 <p>Disable the tabs.</p>
1109 </div>
1110</li>
1111
1112
1113<li class="method" id="method-enable">
1114 <div class="method-header">
1115 <h3 class="method-name"><a href="#method-enable">enable</a></h3>
1116 <dl>
1117 <dt class="method-signature-label">Signature:</dt>
1118 <dd class="method-signature">.tabs( 'enable'
1119
1120
1121
1122
1123
1124
1125
1126)</dd>
1127 </dl>
1128 </div>
1129 <div class="method-description">
1130 <p>Enable the tabs.</p>
1131 </div>
1132</li>
1133
1134
1135<li class="method" id="method-option">
1136 <div class="method-header">
1137 <h3 class="method-name"><a href="#method-option">option</a></h3>
1138 <dl>
1139 <dt class="method-signature-label">Signature:</dt>
1140 <dd class="method-signature">.tabs( 'option'
1141
1142, optionName
1143
1144, <span class="optional">[</span>value<span class="optional">] </span>
1145
1146
1147
1148)</dd>
1149 </dl>
1150 </div>
1151 <div class="method-description">
1152 <p>Get or set any tabs option. If no value is specified, will act as a getter.</p>
1153 </div>
1154</li>
1155
1156
1157<li class="method" id="method-add">
1158 <div class="method-header">
1159 <h3 class="method-name"><a href="#method-add">add</a></h3>
1160 <dl>
1161 <dt class="method-signature-label">Signature:</dt>
1162 <dd class="method-signature">.tabs( 'add'
1163
1164, url
1165
1166, label
1167
1168, <span class="optional">[</span>index<span class="optional">] </span>
1169
1170)</dd>
1171 </dl>
1172 </div>
1173 <div class="method-description">
1174 <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>
1175 </div>
1176</li>
1177
1178
1179<li class="method" id="method-remove">
1180 <div class="method-header">
1181 <h3 class="method-name"><a href="#method-remove">remove</a></h3>
1182 <dl>
1183 <dt class="method-signature-label">Signature:</dt>
1184 <dd class="method-signature">.tabs( 'remove'
1185
1186, index
1187
1188
1189
1190
1191
1192)</dd>
1193 </dl>
1194 </div>
1195 <div class="method-description">
1196 <p>Remove a tab. The second argument is the zero-based index of the tab to be removed.</p>
1197 </div>
1198</li>
1199
1200
1201<li class="method" id="method-enable">
1202 <div class="method-header">
1203 <h3 class="method-name"><a href="#method-enable">enable</a></h3>
1204 <dl>
1205 <dt class="method-signature-label">Signature:</dt>
1206 <dd class="method-signature">.tabs( 'enable'
1207
1208, index
1209
1210
1211
1212
1213
1214)</dd>
1215 </dl>
1216 </div>
1217 <div class="method-description">
1218 <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>
1219 </div>
1220</li>
1221
1222
1223<li class="method" id="method-disable">
1224 <div class="method-header">
1225 <h3 class="method-name"><a href="#method-disable">disable</a></h3>
1226 <dl>
1227 <dt class="method-signature-label">Signature:</dt>
1228 <dd class="method-signature">.tabs( 'disable'
1229
1230, index
1231
1232
1233
1234
1235
1236)</dd>
1237 </dl>
1238 </div>
1239 <div class="method-description">
1240 <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>
1241 </div>
1242</li>
1243
1244
1245<li class="method" id="method-select">
1246 <div class="method-header">
1247 <h3 class="method-name"><a href="#method-select">select</a></h3>
1248 <dl>
1249 <dt class="method-signature-label">Signature:</dt>
1250 <dd class="method-signature">.tabs( 'select'
1251
1252, index
1253
1254
1255
1256
1257
1258)</dd>
1259 </dl>
1260 </div>
1261 <div class="method-description">
1262 <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>
1263 </div>
1264</li>
1265
1266
1267<li class="method" id="method-load">
1268 <div class="method-header">
1269 <h3 class="method-name"><a href="#method-load">load</a></h3>
1270 <dl>
1271 <dt class="method-signature-label">Signature:</dt>
1272 <dd class="method-signature">.tabs( 'load'
1273
1274, index
1275
1276
1277
1278
1279
1280)</dd>
1281 </dl>
1282 </div>
1283 <div class="method-description">
1284 <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>
1285 </div>
1286</li>
1287
1288
1289<li class="method" id="method-url">
1290 <div class="method-header">
1291 <h3 class="method-name"><a href="#method-url">url</a></h3>
1292 <dl>
1293 <dt class="method-signature-label">Signature:</dt>
1294 <dd class="method-signature">.tabs( 'url'
1295
1296, index
1297
1298, url
1299
1300
1301
1302)</dd>
1303 </dl>
1304 </div>
1305 <div class="method-description">
1306 <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>
1307 </div>
1308</li>
1309
1310
1311<li class="method" id="method-length">
1312 <div class="method-header">
1313 <h3 class="method-name"><a href="#method-length">length</a></h3>
1314 <dl>
1315 <dt class="method-signature-label">Signature:</dt>
1316 <dd class="method-signature">.tabs( 'length'
1317
1318
1319
1320
1321
1322
1323
1324)</dd>
1325 </dl>
1326 </div>
1327 <div class="method-description">
1328 <p>Retrieve the number of tabs of the first matched tab pane.</p>
1329 </div>
1330</li>
1331
1332
1333<li class="method" id="method-abort">
1334 <div class="method-header">
1335 <h3 class="method-name"><a href="#method-abort">abort</a></h3>
1336 <dl>
1337 <dt class="method-signature-label">Signature:</dt>
1338 <dd class="method-signature">.tabs( 'abort'
1339
1340
1341
1342
1343
1344
1345
1346)</dd>
1347 </dl>
1348 </div>
1349 <div class="method-description">
1350 <p>Terminate all running tab ajax requests and animations.</p>
1351 </div>
1352</li>
1353
1354
1355<li class="method" id="method-rotate">
1356 <div class="method-header">
1357 <h3 class="method-name"><a href="#method-rotate">rotate</a></h3>
1358 <dl>
1359 <dt class="method-signature-label">Signature:</dt>
1360 <dd class="method-signature">.tabs( 'rotate'
1361
1362, ms
1363
1364, <span class="optional">[</span>continuing<span class="optional">] </span>
1365
1366
1367
1368)</dd>
1369 </dl>
1370 </div>
1371 <div class="method-description">
1372 <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>
1373 </div>
1374</li>
1375
1376 </ul>
1377 </div>
1378 <div id="theming">
1379 <h2 class="top-header">Theming</h2>
1380 <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.
1381</p>
1382 <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.
1383</p>
1384
1385 <h3>Sample markup with jQuery UI CSS Framework classes</h3>
1386 &lt;div class=&quot;<strong>ui-tabs</strong> ui-widget ui-widget-content ui-corner-all&quot; id=&quot;tabs&quot;&gt;<br />
1387&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 />
1388&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 />
1389&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 />
1390&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 />
1391&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Tab one content goes here.&lt;/p&gt;<br />
1392&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
1393&nbsp;&nbsp;&nbsp; ...<br />
1394&lt;/div&gt;<br />
1395 <p class="theme-note">
1396 <strong>
1397 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 />
1398&#160;&#160;&#160;&lt;ul&gt;<br />
1399&#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 />
1400&#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 />
1401&#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 />
1402&#160;&#160;&#160;&lt;/ul&gt;<br />
1403&#160;&#160;&#160;&lt;div id=&quot;tabs-1&quot;&gt;<br />
1404&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 1 content&lt;/p&gt;<br />
1405&#160;&#160;&#160;&lt;/div&gt;<br />
1406&#160;&#160;&#160;&lt;div id=&quot;tabs-2&quot;&gt;<br />
1407&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 2 content&lt;/p&gt;<br />
1408&#160;&#160;&#160;&lt;/div&gt;<br />
1409&#160;&#160;&#160;&lt;div id=&quot;tabs-3&quot;&gt;<br />
1410&#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 3 content&lt;/p&gt;<br />
1411&#160;&#160;&#160;&lt;/div&gt;<br />
1412&lt;/div&gt;.
1413 </strong>
1414 </p>
1415
1416 </div>
1417</div>
1418
1419</p><!--
1420Pre-expand include size: 51548 bytes
1421Post-expand include size: 88927 bytes
1422Template argument size: 55315 bytes
1423Maximum: 2097152 bytes
1424-->
1425
1426<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3777-1!1!0!!en!2 and timestamp 20100128052931 -->
Note: See TracBrowser for help on using the repository browser.