client/player/development-bundle/docs/tabs.html
changeset 1 436d4791d7ac
equal deleted inserted replaced
0:ecdfc63274bf 1:436d4791d7ac
       
     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
       
    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="...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.
       
   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         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>
       
   170 resizeMap() 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">
       
   188 A 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 href=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
       
   198   &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
       
   199   &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
       
   200   
       
   201   &lt;script&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-disabled">
       
   241   <div class="option-header">
       
   242     <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
       
   243     <dl>
       
   244       <dt class="option-type-label">Type:</dt>
       
   245         <dd class="option-type">Boolean</dd>
       
   246       
       
   247       <dt class="option-default-label">Default:</dt>
       
   248         <dd class="option-default">false</dd>
       
   249       
       
   250     </dl>
       
   251   </div>
       
   252   <div class="option-description">
       
   253     <p>Disables (true) or enables (false) the tabs. Can be set when initialising (first creating) the tabs.</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>disabled</code> option specified.
       
   261 </dt>
       
   262 <dd>
       
   263 <pre><code>$( ".selector" ).tabs({ disabled: true });</code></pre>
       
   264 </dd>
       
   265 
       
   266     
       
   267 <dt>
       
   268   Get or set the <code>disabled</code> option, after init.
       
   269 </dt>
       
   270 <dd>
       
   271 <pre><code>//getter
       
   272 var disabled = $( ".selector" ).tabs( "option", "disabled" );
       
   273 //setter
       
   274 $( ".selector" ).tabs( "option", "disabled", true );</code></pre>
       
   275 </dd>
       
   276 
       
   277     </dl>
       
   278   </div>
       
   279 </li>
       
   280 
       
   281 
       
   282 <li class="option" id="option-ajaxOptions">
       
   283   <div class="option-header">
       
   284     <h3 class="option-name"><a href="#option-ajaxOptions">ajaxOptions</a></h3>
       
   285     <dl>
       
   286       <dt class="option-type-label">Type:</dt>
       
   287         <dd class="option-type">Options</dd>
       
   288       
       
   289       <dt class="option-default-label">Default:</dt>
       
   290         <dd class="option-default">null</dd>
       
   291       
       
   292     </dl>
       
   293   </div>
       
   294   <div class="option-description">
       
   295     <p>Additional Ajax options to consider when loading tab content (see $.ajax).</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>ajaxOptions</code> option specified.
       
   303 </dt>
       
   304 <dd>
       
   305 <pre><code>$( ".selector" ).tabs({ ajaxOptions: { async: false } });</code></pre>
       
   306 </dd>
       
   307 
       
   308     
       
   309 <dt>
       
   310   Get or set the <code>ajaxOptions</code> option, after init.
       
   311 </dt>
       
   312 <dd>
       
   313 <pre><code>//getter
       
   314 var ajaxOptions = $( ".selector" ).tabs( "option", "ajaxOptions" );
       
   315 //setter
       
   316 $( ".selector" ).tabs( "option", "ajaxOptions", { async: false } );</code></pre>
       
   317 </dd>
       
   318 
       
   319     </dl>
       
   320   </div>
       
   321 </li>
       
   322 
       
   323 
       
   324 <li class="option" id="option-cache">
       
   325   <div class="option-header">
       
   326     <h3 class="option-name"><a href="#option-cache">cache</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>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>
       
   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>cache</code> option specified.
       
   345 </dt>
       
   346 <dd>
       
   347 <pre><code>$( ".selector" ).tabs({ cache: true });</code></pre>
       
   348 </dd>
       
   349 
       
   350     
       
   351 <dt>
       
   352   Get or set the <code>cache</code> option, after init.
       
   353 </dt>
       
   354 <dd>
       
   355 <pre><code>//getter
       
   356 var cache = $( ".selector" ).tabs( "option", "cache" );
       
   357 //setter
       
   358 $( ".selector" ).tabs( "option", "cache", true );</code></pre>
       
   359 </dd>
       
   360 
       
   361     </dl>
       
   362   </div>
       
   363 </li>
       
   364 
       
   365 
       
   366 <li class="option" id="option-collapsible">
       
   367   <div class="option-header">
       
   368     <h3 class="option-name"><a href="#option-collapsible">collapsible</a></h3>
       
   369     <dl>
       
   370       <dt class="option-type-label">Type:</dt>
       
   371         <dd class="option-type">Boolean</dd>
       
   372       
       
   373       <dt class="option-default-label">Default:</dt>
       
   374         <dd class="option-default">false</dd>
       
   375       
       
   376     </dl>
       
   377   </div>
       
   378   <div class="option-description">
       
   379     <p>Set to true to allow an already selected tab to become unselected again upon reselection.</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>collapsible</code> option specified.
       
   387 </dt>
       
   388 <dd>
       
   389 <pre><code>$( ".selector" ).tabs({ collapsible: true });</code></pre>
       
   390 </dd>
       
   391 
       
   392     
       
   393 <dt>
       
   394   Get or set the <code>collapsible</code> option, after init.
       
   395 </dt>
       
   396 <dd>
       
   397 <pre><code>//getter
       
   398 var collapsible = $( ".selector" ).tabs( "option", "collapsible" );
       
   399 //setter
       
   400 $( ".selector" ).tabs( "option", "collapsible", true );</code></pre>
       
   401 </dd>
       
   402 
       
   403     </dl>
       
   404   </div>
       
   405 </li>
       
   406 
       
   407 
       
   408 <li class="option" id="option-cookie">
       
   409   <div class="option-header">
       
   410     <h3 class="option-name"><a href="#option-cookie">cookie</a></h3>
       
   411     <dl>
       
   412       <dt class="option-type-label">Type:</dt>
       
   413         <dd class="option-type">Object</dd>
       
   414       
       
   415       <dt class="option-default-label">Default:</dt>
       
   416         <dd class="option-default">null</dd>
       
   417       
       
   418     </dl>
       
   419   </div>
       
   420   <div class="option-description">
       
   421     <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>
       
   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>cookie</code> option specified.
       
   429 </dt>
       
   430 <dd>
       
   431 <pre><code>$( ".selector" ).tabs({ cookie: { expires: 30 } });</code></pre>
       
   432 </dd>
       
   433 
       
   434     
       
   435 <dt>
       
   436   Get or set the <code>cookie</code> option, after init.
       
   437 </dt>
       
   438 <dd>
       
   439 <pre><code>//getter
       
   440 var cookie = $( ".selector" ).tabs( "option", "cookie" );
       
   441 //setter
       
   442 $( ".selector" ).tabs( "option", "cookie", { expires: 30 } );</code></pre>
       
   443 </dd>
       
   444 
       
   445     </dl>
       
   446   </div>
       
   447 </li>
       
   448 
       
   449 
       
   450 <li class="option" id="option-deselectable">
       
   451   <div class="option-header">
       
   452     <h3 class="option-name"><a href="#option-deselectable">deselectable</a></h3>
       
   453     <dl>
       
   454       <dt class="option-type-label">Type:</dt>
       
   455         <dd class="option-type">Boolean</dd>
       
   456       
       
   457       <dt class="option-default-label">Default:</dt>
       
   458         <dd class="option-default">false</dd>
       
   459       
       
   460     </dl>
       
   461   </div>
       
   462   <div class="option-description">
       
   463     <p>deprecated in jQuery UI 1.7, use collapsible.</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>deselectable</code> option specified.
       
   471 </dt>
       
   472 <dd>
       
   473 <pre><code>$( ".selector" ).tabs({ deselectable: true });</code></pre>
       
   474 </dd>
       
   475 
       
   476     
       
   477 <dt>
       
   478   Get or set the <code>deselectable</code> option, after init.
       
   479 </dt>
       
   480 <dd>
       
   481 <pre><code>//getter
       
   482 var deselectable = $( ".selector" ).tabs( "option", "deselectable" );
       
   483 //setter
       
   484 $( ".selector" ).tabs( "option", "deselectable", true );</code></pre>
       
   485 </dd>
       
   486 
       
   487     </dl>
       
   488   </div>
       
   489 </li>
       
   490 
       
   491 
       
   492 <li class="option" id="option-disabled">
       
   493   <div class="option-header">
       
   494     <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
       
   495     <dl>
       
   496       <dt class="option-type-label">Type:</dt>
       
   497         <dd class="option-type">Array&lt;Number&gt;</dd>
       
   498       
       
   499       <dt class="option-default-label">Default:</dt>
       
   500         <dd class="option-default">[]</dd>
       
   501       
       
   502     </dl>
       
   503   </div>
       
   504   <div class="option-description">
       
   505     <p>An array containing the position of the tabs (zero-based index) that should be disabled on initialization.</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>disabled</code> option specified.
       
   513 </dt>
       
   514 <dd>
       
   515 <pre><code>$( ".selector" ).tabs({ disabled: [1, 2] });</code></pre>
       
   516 </dd>
       
   517 
       
   518     
       
   519 <dt>
       
   520   Get or set the <code>disabled</code> option, after init.
       
   521 </dt>
       
   522 <dd>
       
   523 <pre><code>//getter
       
   524 var disabled = $( ".selector" ).tabs( "option", "disabled" );
       
   525 //setter
       
   526 $( ".selector" ).tabs( "option", "disabled", [1, 2] );</code></pre>
       
   527 </dd>
       
   528 
       
   529     </dl>
       
   530   </div>
       
   531 </li>
       
   532 
       
   533 
       
   534 <li class="option" id="option-event">
       
   535   <div class="option-header">
       
   536     <h3 class="option-name"><a href="#option-event">event</a></h3>
       
   537     <dl>
       
   538       <dt class="option-type-label">Type:</dt>
       
   539         <dd class="option-type">String</dd>
       
   540       
       
   541       <dt class="option-default-label">Default:</dt>
       
   542         <dd class="option-default">'click'</dd>
       
   543       
       
   544     </dl>
       
   545   </div>
       
   546   <div class="option-description">
       
   547     <p>The type of event to be used for selecting a tab.</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>event</code> option specified.
       
   555 </dt>
       
   556 <dd>
       
   557 <pre><code>$( ".selector" ).tabs({ event: 'mouseover' });</code></pre>
       
   558 </dd>
       
   559 
       
   560     
       
   561 <dt>
       
   562   Get or set the <code>event</code> option, after init.
       
   563 </dt>
       
   564 <dd>
       
   565 <pre><code>//getter
       
   566 var event = $( ".selector" ).tabs( "option", "event" );
       
   567 //setter
       
   568 $( ".selector" ).tabs( "option", "event", 'mouseover' );</code></pre>
       
   569 </dd>
       
   570 
       
   571     </dl>
       
   572   </div>
       
   573 </li>
       
   574 
       
   575 
       
   576 <li class="option" id="option-fx">
       
   577   <div class="option-header">
       
   578     <h3 class="option-name"><a href="#option-fx">fx</a></h3>
       
   579     <dl>
       
   580       <dt class="option-type-label">Type:</dt>
       
   581         <dd class="option-type">Options, Array&lt;Options&gt;</dd>
       
   582       
       
   583       <dt class="option-default-label">Default:</dt>
       
   584         <dd class="option-default">null</dd>
       
   585       
       
   586     </dl>
       
   587   </div>
       
   588   <div class="option-description">
       
   589     <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>
       
   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>fx</code> option specified.
       
   597 </dt>
       
   598 <dd>
       
   599 <pre><code>$( ".selector" ).tabs({ fx: { opacity: 'toggle' } });</code></pre>
       
   600 </dd>
       
   601 
       
   602     
       
   603 <dt>
       
   604   Get or set the <code>fx</code> option, after init.
       
   605 </dt>
       
   606 <dd>
       
   607 <pre><code>//getter
       
   608 var fx = $( ".selector" ).tabs( "option", "fx" );
       
   609 //setter
       
   610 $( ".selector" ).tabs( "option", "fx", { opacity: 'toggle' } );</code></pre>
       
   611 </dd>
       
   612 
       
   613     </dl>
       
   614   </div>
       
   615 </li>
       
   616 
       
   617 
       
   618 <li class="option" id="option-idPrefix">
       
   619   <div class="option-header">
       
   620     <h3 class="option-name"><a href="#option-idPrefix">idPrefix</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">'ui-tabs-'</dd>
       
   627       
       
   628     </dl>
       
   629   </div>
       
   630   <div class="option-description">
       
   631     <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>
       
   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>idPrefix</code> option specified.
       
   639 </dt>
       
   640 <dd>
       
   641 <pre><code>$( ".selector" ).tabs({ idPrefix: 'ui-tabs-primary' });</code></pre>
       
   642 </dd>
       
   643 
       
   644     
       
   645 <dt>
       
   646   Get or set the <code>idPrefix</code> option, after init.
       
   647 </dt>
       
   648 <dd>
       
   649 <pre><code>//getter
       
   650 var idPrefix = $( ".selector" ).tabs( "option", "idPrefix" );
       
   651 //setter
       
   652 $( ".selector" ).tabs( "option", "idPrefix", 'ui-tabs-primary' );</code></pre>
       
   653 </dd>
       
   654 
       
   655     </dl>
       
   656   </div>
       
   657 </li>
       
   658 
       
   659 
       
   660 <li class="option" id="option-panelTemplate">
       
   661   <div class="option-header">
       
   662     <h3 class="option-name"><a href="#option-panelTemplate">panelTemplate</a></h3>
       
   663     <dl>
       
   664       <dt class="option-type-label">Type:</dt>
       
   665         <dd class="option-type">String</dd>
       
   666       
       
   667       <dt class="option-default-label">Default:</dt>
       
   668         <dd class="option-default">'&lt;div&gt;&lt;/div&gt;'</dd>
       
   669       
       
   670     </dl>
       
   671   </div>
       
   672   <div class="option-description">
       
   673     <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>
       
   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>panelTemplate</code> option specified.
       
   681 </dt>
       
   682 <dd>
       
   683 <pre><code>$( ".selector" ).tabs({ panelTemplate: '&lt;li&gt;&lt;/li&gt;' });</code></pre>
       
   684 </dd>
       
   685 
       
   686     
       
   687 <dt>
       
   688   Get or set the <code>panelTemplate</code> option, after init.
       
   689 </dt>
       
   690 <dd>
       
   691 <pre><code>//getter
       
   692 var panelTemplate = $( ".selector" ).tabs( "option", "panelTemplate" );
       
   693 //setter
       
   694 $( ".selector" ).tabs( "option", "panelTemplate", '&lt;li&gt;&lt;/li&gt;' );</code></pre>
       
   695 </dd>
       
   696 
       
   697     </dl>
       
   698   </div>
       
   699 </li>
       
   700 
       
   701 
       
   702 <li class="option" id="option-selected">
       
   703   <div class="option-header">
       
   704     <h3 class="option-name"><a href="#option-selected">selected</a></h3>
       
   705     <dl>
       
   706       <dt class="option-type-label">Type:</dt>
       
   707         <dd class="option-type">Number</dd>
       
   708       
       
   709       <dt class="option-default-label">Default:</dt>
       
   710         <dd class="option-default">0</dd>
       
   711       
       
   712     </dl>
       
   713   </div>
       
   714   <div class="option-description">
       
   715     <p>Zero-based index of the tab to be selected on initialization. To set all tabs to unselected pass -1 as value.</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>selected</code> option specified.
       
   723 </dt>
       
   724 <dd>
       
   725 <pre><code>$( ".selector" ).tabs({ selected: 3 });</code></pre>
       
   726 </dd>
       
   727 
       
   728     
       
   729 <dt>
       
   730   Get or set the <code>selected</code> option, after init.
       
   731 </dt>
       
   732 <dd>
       
   733 <pre><code>//getter
       
   734 var selected = $( ".selector" ).tabs( "option", "selected" );
       
   735 //setter
       
   736 $( ".selector" ).tabs( "option", "selected", 3 );</code></pre>
       
   737 </dd>
       
   738 
       
   739     </dl>
       
   740   </div>
       
   741 </li>
       
   742 
       
   743 
       
   744 <li class="option" id="option-spinner">
       
   745   <div class="option-header">
       
   746     <h3 class="option-name"><a href="#option-spinner">spinner</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;em&gt;Loading&amp;#8230;&lt;/em&gt;'</dd>
       
   753       
       
   754     </dl>
       
   755   </div>
       
   756   <div class="option-description">
       
   757     <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. An span element must be present in the A tag of the title, for the spinner content to be visible.</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>spinner</code> option specified.
       
   765 </dt>
       
   766 <dd>
       
   767 <pre><code>$( ".selector" ).tabs({ spinner: 'Retrieving data...' });</code></pre>
       
   768 </dd>
       
   769 
       
   770     
       
   771 <dt>
       
   772   Get or set the <code>spinner</code> option, after init.
       
   773 </dt>
       
   774 <dd>
       
   775 <pre><code>//getter
       
   776 var spinner = $( ".selector" ).tabs( "option", "spinner" );
       
   777 //setter
       
   778 $( ".selector" ).tabs( "option", "spinner", 'Retrieving data...' );</code></pre>
       
   779 </dd>
       
   780 
       
   781     </dl>
       
   782   </div>
       
   783 </li>
       
   784 
       
   785 
       
   786 <li class="option" id="option-tabTemplate">
       
   787   <div class="option-header">
       
   788     <h3 class="option-name"><a href="#option-tabTemplate">tabTemplate</a></h3>
       
   789     <dl>
       
   790       <dt class="option-type-label">Type:</dt>
       
   791         <dd class="option-type">String</dd>
       
   792       
       
   793       <dt class="option-default-label">Default:</dt>
       
   794         <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>
       
   795       
       
   796     </dl>
       
   797   </div>
       
   798   <div class="option-description">
       
   799     <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>
       
   800   </div>
       
   801   <div class="option-examples">
       
   802     <h4>Code examples</h4>
       
   803     <dl class="option-examples-list">
       
   804     
       
   805 <dt>
       
   806   Initialize a tabs with the <code>tabTemplate</code> option specified.
       
   807 </dt>
       
   808 <dd>
       
   809 <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>
       
   810 </dd>
       
   811 
       
   812     
       
   813 <dt>
       
   814   Get or set the <code>tabTemplate</code> option, after init.
       
   815 </dt>
       
   816 <dd>
       
   817 <pre><code>//getter
       
   818 var tabTemplate = $( ".selector" ).tabs( "option", "tabTemplate" );
       
   819 //setter
       
   820 $( ".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>
       
   821 </dd>
       
   822 
       
   823     </dl>
       
   824   </div>
       
   825 </li>
       
   826 
       
   827     </ul>
       
   828   </div>
       
   829   <div id="events">
       
   830     <h2 class="top-header">Events</h2>
       
   831     <ul class="events-list">
       
   832       
       
   833 <li class="event" id="event-select">
       
   834   <div class="event-header">
       
   835     <h3 class="event-name"><a href="#event-select">select</a></h3>
       
   836     <dl>
       
   837       <dt class="event-type-label">Type:</dt>
       
   838         <dd class="event-type">tabsselect</dd>
       
   839     </dl>
       
   840   </div>
       
   841   <div class="event-description">
       
   842     <p>This event is triggered when clicking a tab.</p>
       
   843   </div>
       
   844   <div class="event-examples">
       
   845     <h4>Code examples</h4>
       
   846     <dl class="event-examples-list">
       
   847     
       
   848 <dt>
       
   849   Supply a callback function to handle the <code>select</code> event as an init option.
       
   850 </dt>
       
   851 <dd>
       
   852 <pre><code>$( &quot;.selector&quot; ).tabs({
       
   853    select: function(event, ui) { ... }
       
   854 });</code></pre>
       
   855 </dd>
       
   856 
       
   857     
       
   858 <dt>
       
   859   Bind to the <code>select</code> event by type: <code>tabsselect</code>.
       
   860 </dt>
       
   861 <dd>
       
   862 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsselect&quot;, function(event, ui) {
       
   863   ...
       
   864 });</code></pre>
       
   865 </dd>
       
   866 
       
   867     </dl>
       
   868   </div>
       
   869 </li>
       
   870 
       
   871 
       
   872 <li class="event" id="event-load">
       
   873   <div class="event-header">
       
   874     <h3 class="event-name"><a href="#event-load">load</a></h3>
       
   875     <dl>
       
   876       <dt class="event-type-label">Type:</dt>
       
   877         <dd class="event-type">tabsload</dd>
       
   878     </dl>
       
   879   </div>
       
   880   <div class="event-description">
       
   881     <p>This event is triggered after the content of a remote tab has been loaded.</p>
       
   882   </div>
       
   883   <div class="event-examples">
       
   884     <h4>Code examples</h4>
       
   885     <dl class="event-examples-list">
       
   886     
       
   887 <dt>
       
   888   Supply a callback function to handle the <code>load</code> event as an init option.
       
   889 </dt>
       
   890 <dd>
       
   891 <pre><code>$( &quot;.selector&quot; ).tabs({
       
   892    load: function(event, ui) { ... }
       
   893 });</code></pre>
       
   894 </dd>
       
   895 
       
   896     
       
   897 <dt>
       
   898   Bind to the <code>load</code> event by type: <code>tabsload</code>.
       
   899 </dt>
       
   900 <dd>
       
   901 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsload&quot;, function(event, ui) {
       
   902   ...
       
   903 });</code></pre>
       
   904 </dd>
       
   905 
       
   906     </dl>
       
   907   </div>
       
   908 </li>
       
   909 
       
   910 
       
   911 <li class="event" id="event-show">
       
   912   <div class="event-header">
       
   913     <h3 class="event-name"><a href="#event-show">show</a></h3>
       
   914     <dl>
       
   915       <dt class="event-type-label">Type:</dt>
       
   916         <dd class="event-type">tabsshow</dd>
       
   917     </dl>
       
   918   </div>
       
   919   <div class="event-description">
       
   920     <p>This event is triggered when a tab is shown.</p>
       
   921   </div>
       
   922   <div class="event-examples">
       
   923     <h4>Code examples</h4>
       
   924     <dl class="event-examples-list">
       
   925     
       
   926 <dt>
       
   927   Supply a callback function to handle the <code>show</code> event as an init option.
       
   928 </dt>
       
   929 <dd>
       
   930 <pre><code>$( &quot;.selector&quot; ).tabs({
       
   931    show: function(event, ui) { ... }
       
   932 });</code></pre>
       
   933 </dd>
       
   934 
       
   935     
       
   936 <dt>
       
   937   Bind to the <code>show</code> event by type: <code>tabsshow</code>.
       
   938 </dt>
       
   939 <dd>
       
   940 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsshow&quot;, function(event, ui) {
       
   941   ...
       
   942 });</code></pre>
       
   943 </dd>
       
   944 
       
   945     </dl>
       
   946   </div>
       
   947 </li>
       
   948 
       
   949 
       
   950 <li class="event" id="event-add">
       
   951   <div class="event-header">
       
   952     <h3 class="event-name"><a href="#event-add">add</a></h3>
       
   953     <dl>
       
   954       <dt class="event-type-label">Type:</dt>
       
   955         <dd class="event-type">tabsadd</dd>
       
   956     </dl>
       
   957   </div>
       
   958   <div class="event-description">
       
   959     <p>This event is triggered when a tab is added.</p>
       
   960   </div>
       
   961   <div class="event-examples">
       
   962     <h4>Code examples</h4>
       
   963     <dl class="event-examples-list">
       
   964     
       
   965 <dt>
       
   966   Supply a callback function to handle the <code>add</code> event as an init option.
       
   967 </dt>
       
   968 <dd>
       
   969 <pre><code>$( &quot;.selector&quot; ).tabs({
       
   970    add: function(event, ui) { ... }
       
   971 });</code></pre>
       
   972 </dd>
       
   973 
       
   974     
       
   975 <dt>
       
   976   Bind to the <code>add</code> event by type: <code>tabsadd</code>.
       
   977 </dt>
       
   978 <dd>
       
   979 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsadd&quot;, function(event, ui) {
       
   980   ...
       
   981 });</code></pre>
       
   982 </dd>
       
   983 
       
   984     </dl>
       
   985   </div>
       
   986 </li>
       
   987 
       
   988 
       
   989 <li class="event" id="event-remove">
       
   990   <div class="event-header">
       
   991     <h3 class="event-name"><a href="#event-remove">remove</a></h3>
       
   992     <dl>
       
   993       <dt class="event-type-label">Type:</dt>
       
   994         <dd class="event-type">tabsremove</dd>
       
   995     </dl>
       
   996   </div>
       
   997   <div class="event-description">
       
   998     <p>This event is triggered when a tab is removed.</p>
       
   999   </div>
       
  1000   <div class="event-examples">
       
  1001     <h4>Code examples</h4>
       
  1002     <dl class="event-examples-list">
       
  1003     
       
  1004 <dt>
       
  1005   Supply a callback function to handle the <code>remove</code> event as an init option.
       
  1006 </dt>
       
  1007 <dd>
       
  1008 <pre><code>$( &quot;.selector&quot; ).tabs({
       
  1009    remove: function(event, ui) { ... }
       
  1010 });</code></pre>
       
  1011 </dd>
       
  1012 
       
  1013     
       
  1014 <dt>
       
  1015   Bind to the <code>remove</code> event by type: <code>tabsremove</code>.
       
  1016 </dt>
       
  1017 <dd>
       
  1018 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsremove&quot;, function(event, ui) {
       
  1019   ...
       
  1020 });</code></pre>
       
  1021 </dd>
       
  1022 
       
  1023     </dl>
       
  1024   </div>
       
  1025 </li>
       
  1026 
       
  1027 
       
  1028 <li class="event" id="event-enable">
       
  1029   <div class="event-header">
       
  1030     <h3 class="event-name"><a href="#event-enable">enable</a></h3>
       
  1031     <dl>
       
  1032       <dt class="event-type-label">Type:</dt>
       
  1033         <dd class="event-type">tabsenable</dd>
       
  1034     </dl>
       
  1035   </div>
       
  1036   <div class="event-description">
       
  1037     <p>This event is triggered when a tab is enabled.</p>
       
  1038   </div>
       
  1039   <div class="event-examples">
       
  1040     <h4>Code examples</h4>
       
  1041     <dl class="event-examples-list">
       
  1042     
       
  1043 <dt>
       
  1044   Supply a callback function to handle the <code>enable</code> event as an init option.
       
  1045 </dt>
       
  1046 <dd>
       
  1047 <pre><code>$( &quot;.selector&quot; ).tabs({
       
  1048    enable: function(event, ui) { ... }
       
  1049 });</code></pre>
       
  1050 </dd>
       
  1051 
       
  1052     
       
  1053 <dt>
       
  1054   Bind to the <code>enable</code> event by type: <code>tabsenable</code>.
       
  1055 </dt>
       
  1056 <dd>
       
  1057 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsenable&quot;, function(event, ui) {
       
  1058   ...
       
  1059 });</code></pre>
       
  1060 </dd>
       
  1061 
       
  1062     </dl>
       
  1063   </div>
       
  1064 </li>
       
  1065 
       
  1066 
       
  1067 <li class="event" id="event-disable">
       
  1068   <div class="event-header">
       
  1069     <h3 class="event-name"><a href="#event-disable">disable</a></h3>
       
  1070     <dl>
       
  1071       <dt class="event-type-label">Type:</dt>
       
  1072         <dd class="event-type">tabsdisable</dd>
       
  1073     </dl>
       
  1074   </div>
       
  1075   <div class="event-description">
       
  1076     <p>This event is triggered when a tab is disabled.</p>
       
  1077   </div>
       
  1078   <div class="event-examples">
       
  1079     <h4>Code examples</h4>
       
  1080     <dl class="event-examples-list">
       
  1081     
       
  1082 <dt>
       
  1083   Supply a callback function to handle the <code>disable</code> event as an init option.
       
  1084 </dt>
       
  1085 <dd>
       
  1086 <pre><code>$( &quot;.selector&quot; ).tabs({
       
  1087    disable: function(event, ui) { ... }
       
  1088 });</code></pre>
       
  1089 </dd>
       
  1090 
       
  1091     
       
  1092 <dt>
       
  1093   Bind to the <code>disable</code> event by type: <code>tabsdisable</code>.
       
  1094 </dt>
       
  1095 <dd>
       
  1096 <pre><code>$( &quot;.selector&quot; ).bind( &quot;tabsdisable&quot;, function(event, ui) {
       
  1097   ...
       
  1098 });</code></pre>
       
  1099 </dd>
       
  1100 
       
  1101     </dl>
       
  1102   </div>
       
  1103 </li>
       
  1104 
       
  1105     </ul>
       
  1106   </div>
       
  1107   <div id="methods">
       
  1108     <h2 class="top-header">Methods</h2>
       
  1109     <ul class="methods-list">
       
  1110       
       
  1111 <li class="method" id="method-destroy">
       
  1112   <div class="method-header">
       
  1113     <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
       
  1114     <dl>
       
  1115       <dt class="method-signature-label">Signature:</dt>
       
  1116         <dd class="method-signature">.tabs( "destroy"
       
  1117 
       
  1118 
       
  1119 
       
  1120 
       
  1121 
       
  1122 
       
  1123 
       
  1124 )</dd>
       
  1125     </dl>
       
  1126   </div>
       
  1127   <div class="method-description">
       
  1128     <p>Remove the tabs functionality completely. This will return the element back to its pre-init state.</p>
       
  1129   </div>
       
  1130 </li>
       
  1131 
       
  1132 
       
  1133 <li class="method" id="method-disable">
       
  1134   <div class="method-header">
       
  1135     <h3 class="method-name"><a href="#method-disable">disable</a></h3>
       
  1136     <dl>
       
  1137       <dt class="method-signature-label">Signature:</dt>
       
  1138         <dd class="method-signature">.tabs( "disable"
       
  1139 
       
  1140 
       
  1141 
       
  1142 
       
  1143 
       
  1144 
       
  1145 
       
  1146 )</dd>
       
  1147     </dl>
       
  1148   </div>
       
  1149   <div class="method-description">
       
  1150     <p>Disable the tabs.</p>
       
  1151   </div>
       
  1152 </li>
       
  1153 
       
  1154 
       
  1155 <li class="method" id="method-enable">
       
  1156   <div class="method-header">
       
  1157     <h3 class="method-name"><a href="#method-enable">enable</a></h3>
       
  1158     <dl>
       
  1159       <dt class="method-signature-label">Signature:</dt>
       
  1160         <dd class="method-signature">.tabs( "enable"
       
  1161 
       
  1162 
       
  1163 
       
  1164 
       
  1165 
       
  1166 
       
  1167 
       
  1168 )</dd>
       
  1169     </dl>
       
  1170   </div>
       
  1171   <div class="method-description">
       
  1172     <p>Enable the tabs.</p>
       
  1173   </div>
       
  1174 </li>
       
  1175 
       
  1176 
       
  1177 <li class="method" id="method-option">
       
  1178   <div class="method-header">
       
  1179     <h3 class="method-name"><a href="#method-option">option</a></h3>
       
  1180     <dl>
       
  1181       <dt class="method-signature-label">Signature:</dt>
       
  1182         <dd class="method-signature">.tabs( "option"
       
  1183 
       
  1184 , optionName
       
  1185 
       
  1186 , <span class="optional">[</span>value<span class="optional">] </span>
       
  1187 
       
  1188 
       
  1189 
       
  1190 )</dd>
       
  1191     </dl>
       
  1192   </div>
       
  1193   <div class="method-description">
       
  1194     <p>Get or set any tabs option. If no value is specified, will act as a getter.</p>
       
  1195   </div>
       
  1196 </li>
       
  1197 
       
  1198 
       
  1199 <li class="method" id="method-option">
       
  1200   <div class="method-header">
       
  1201     <h3 class="method-name"><a href="#method-option">option</a></h3>
       
  1202     <dl>
       
  1203       <dt class="method-signature-label">Signature:</dt>
       
  1204         <dd class="method-signature">.tabs( "option"
       
  1205 
       
  1206 , options
       
  1207 
       
  1208 
       
  1209 
       
  1210 
       
  1211 
       
  1212 )</dd>
       
  1213     </dl>
       
  1214   </div>
       
  1215   <div class="method-description">
       
  1216     <p>Set multiple tabs options at once by providing an options object.</p>
       
  1217   </div>
       
  1218 </li>
       
  1219 
       
  1220 
       
  1221 <li class="method" id="method-widget">
       
  1222   <div class="method-header">
       
  1223     <h3 class="method-name"><a href="#method-widget">widget</a></h3>
       
  1224     <dl>
       
  1225       <dt class="method-signature-label">Signature:</dt>
       
  1226         <dd class="method-signature">.tabs( "widget"
       
  1227 
       
  1228 
       
  1229 
       
  1230 
       
  1231 
       
  1232 
       
  1233 
       
  1234 )</dd>
       
  1235     </dl>
       
  1236   </div>
       
  1237   <div class="method-description">
       
  1238     <p>Returns the .ui-tabs element.</p>
       
  1239   </div>
       
  1240 </li>
       
  1241 
       
  1242 
       
  1243 <li class="method" id="method-add">
       
  1244   <div class="method-header">
       
  1245     <h3 class="method-name"><a href="#method-add">add</a></h3>
       
  1246     <dl>
       
  1247       <dt class="method-signature-label">Signature:</dt>
       
  1248         <dd class="method-signature">.tabs( "add"
       
  1249 
       
  1250 , url
       
  1251 
       
  1252 , label
       
  1253 
       
  1254 , <span class="optional">[</span>index<span class="optional">] </span>
       
  1255 
       
  1256 )</dd>
       
  1257     </dl>
       
  1258   </div>
       
  1259   <div class="method-description">
       
  1260     <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>
       
  1261   </div>
       
  1262 </li>
       
  1263 
       
  1264 
       
  1265 <li class="method" id="method-remove">
       
  1266   <div class="method-header">
       
  1267     <h3 class="method-name"><a href="#method-remove">remove</a></h3>
       
  1268     <dl>
       
  1269       <dt class="method-signature-label">Signature:</dt>
       
  1270         <dd class="method-signature">.tabs( "remove"
       
  1271 
       
  1272 , index
       
  1273 
       
  1274 
       
  1275 
       
  1276 
       
  1277 
       
  1278 )</dd>
       
  1279     </dl>
       
  1280   </div>
       
  1281   <div class="method-description">
       
  1282     <p>Remove a tab. The second argument is the zero-based index of the tab to be removed.</p>
       
  1283   </div>
       
  1284 </li>
       
  1285 
       
  1286 
       
  1287 <li class="method" id="method-enable">
       
  1288   <div class="method-header">
       
  1289     <h3 class="method-name"><a href="#method-enable">enable</a></h3>
       
  1290     <dl>
       
  1291       <dt class="method-signature-label">Signature:</dt>
       
  1292         <dd class="method-signature">.tabs( "enable"
       
  1293 
       
  1294 , index
       
  1295 
       
  1296 
       
  1297 
       
  1298 
       
  1299 
       
  1300 )</dd>
       
  1301     </dl>
       
  1302   </div>
       
  1303   <div class="method-description">
       
  1304     <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>
       
  1305   </div>
       
  1306 </li>
       
  1307 
       
  1308 
       
  1309 <li class="method" id="method-disable">
       
  1310   <div class="method-header">
       
  1311     <h3 class="method-name"><a href="#method-disable">disable</a></h3>
       
  1312     <dl>
       
  1313       <dt class="method-signature-label">Signature:</dt>
       
  1314         <dd class="method-signature">.tabs( "disable"
       
  1315 
       
  1316 , index
       
  1317 
       
  1318 
       
  1319 
       
  1320 
       
  1321 
       
  1322 )</dd>
       
  1323     </dl>
       
  1324   </div>
       
  1325   <div class="method-description">
       
  1326     <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>
       
  1327   </div>
       
  1328 </li>
       
  1329 
       
  1330 
       
  1331 <li class="method" id="method-select">
       
  1332   <div class="method-header">
       
  1333     <h3 class="method-name"><a href="#method-select">select</a></h3>
       
  1334     <dl>
       
  1335       <dt class="method-signature-label">Signature:</dt>
       
  1336         <dd class="method-signature">.tabs( "select"
       
  1337 
       
  1338 , index
       
  1339 
       
  1340 
       
  1341 
       
  1342 
       
  1343 
       
  1344 )</dd>
       
  1345     </dl>
       
  1346   </div>
       
  1347   <div class="method-description">
       
  1348     <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>
       
  1349   </div>
       
  1350 </li>
       
  1351 
       
  1352 
       
  1353 <li class="method" id="method-load">
       
  1354   <div class="method-header">
       
  1355     <h3 class="method-name"><a href="#method-load">load</a></h3>
       
  1356     <dl>
       
  1357       <dt class="method-signature-label">Signature:</dt>
       
  1358         <dd class="method-signature">.tabs( "load"
       
  1359 
       
  1360 , index
       
  1361 
       
  1362 
       
  1363 
       
  1364 
       
  1365 
       
  1366 )</dd>
       
  1367     </dl>
       
  1368   </div>
       
  1369   <div class="method-description">
       
  1370     <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>
       
  1371   </div>
       
  1372 </li>
       
  1373 
       
  1374 
       
  1375 <li class="method" id="method-url">
       
  1376   <div class="method-header">
       
  1377     <h3 class="method-name"><a href="#method-url">url</a></h3>
       
  1378     <dl>
       
  1379       <dt class="method-signature-label">Signature:</dt>
       
  1380         <dd class="method-signature">.tabs( "url"
       
  1381 
       
  1382 , index
       
  1383 
       
  1384 , url
       
  1385 
       
  1386 
       
  1387 
       
  1388 )</dd>
       
  1389     </dl>
       
  1390   </div>
       
  1391   <div class="method-description">
       
  1392     <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>
       
  1393   </div>
       
  1394 </li>
       
  1395 
       
  1396 
       
  1397 <li class="method" id="method-length">
       
  1398   <div class="method-header">
       
  1399     <h3 class="method-name"><a href="#method-length">length</a></h3>
       
  1400     <dl>
       
  1401       <dt class="method-signature-label">Signature:</dt>
       
  1402         <dd class="method-signature">.tabs( "length"
       
  1403 
       
  1404 
       
  1405 
       
  1406 
       
  1407 
       
  1408 
       
  1409 
       
  1410 )</dd>
       
  1411     </dl>
       
  1412   </div>
       
  1413   <div class="method-description">
       
  1414     <p>Retrieve the number of tabs of the first matched tab pane.</p>
       
  1415   </div>
       
  1416 </li>
       
  1417 
       
  1418 
       
  1419 <li class="method" id="method-abort">
       
  1420   <div class="method-header">
       
  1421     <h3 class="method-name"><a href="#method-abort">abort</a></h3>
       
  1422     <dl>
       
  1423       <dt class="method-signature-label">Signature:</dt>
       
  1424         <dd class="method-signature">.tabs( "abort"
       
  1425 
       
  1426 
       
  1427 
       
  1428 
       
  1429 
       
  1430 
       
  1431 
       
  1432 )</dd>
       
  1433     </dl>
       
  1434   </div>
       
  1435   <div class="method-description">
       
  1436     <p>Terminate all running tab ajax requests and animations.</p>
       
  1437   </div>
       
  1438 </li>
       
  1439 
       
  1440 
       
  1441 <li class="method" id="method-rotate">
       
  1442   <div class="method-header">
       
  1443     <h3 class="method-name"><a href="#method-rotate">rotate</a></h3>
       
  1444     <dl>
       
  1445       <dt class="method-signature-label">Signature:</dt>
       
  1446         <dd class="method-signature">.tabs( "rotate"
       
  1447 
       
  1448 , ms
       
  1449 
       
  1450 , <span class="optional">[</span>continuing<span class="optional">] </span>
       
  1451 
       
  1452 
       
  1453 
       
  1454 )</dd>
       
  1455     </dl>
       
  1456   </div>
       
  1457   <div class="method-description">
       
  1458     <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>
       
  1459   </div>
       
  1460 </li>
       
  1461 
       
  1462     </ul>
       
  1463   </div>
       
  1464   <div id="theming">
       
  1465     <h2 class="top-header">Theming</h2>
       
  1466     <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.
       
  1467 </p>
       
  1468   <p>If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.tabs.css stylesheet that can be modified. These classes are highlighed in bold below.
       
  1469 </p>
       
  1470     
       
  1471   <h3>Sample markup with jQuery UI CSS Framework classes</h3>
       
  1472   &lt;div class=&quot;<strong>ui-tabs</strong> ui-widget ui-widget-content ui-corner-all&quot; id=&quot;tabs&quot;&gt;<br />
       
  1473 &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 />
       
  1474 &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 />
       
  1475 &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 />
       
  1476 &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 />
       
  1477 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Tab one content goes here.&lt;/p&gt;<br />
       
  1478 &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
       
  1479 &nbsp;&nbsp;&nbsp; ...<br />
       
  1480 &lt;/div&gt;<br />
       
  1481   <p class="theme-note">
       
  1482     <strong>
       
  1483       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 />
       
  1484 &#160;&#160;&#160;&lt;ul&gt;<br />
       
  1485 &#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 />
       
  1486 &#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 />
       
  1487 &#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 />
       
  1488 &#160;&#160;&#160;&lt;/ul&gt;<br />
       
  1489 &#160;&#160;&#160;&lt;div id=&quot;tabs-1&quot;&gt;<br />
       
  1490 &#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 1 content&lt;/p&gt;<br />
       
  1491 &#160;&#160;&#160;&lt;/div&gt;<br />
       
  1492 &#160;&#160;&#160;&lt;div id=&quot;tabs-2&quot;&gt;<br />
       
  1493 &#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 2 content&lt;/p&gt;<br />
       
  1494 &#160;&#160;&#160;&lt;/div&gt;<br />
       
  1495 &#160;&#160;&#160;&lt;div id=&quot;tabs-3&quot;&gt;<br />
       
  1496 &#160;&#160;&#160;&#160;&#160;&#160;&lt;p&gt;Tab 3 content&lt;/p&gt;<br />
       
  1497 &#160;&#160;&#160;&lt;/div&gt;<br />
       
  1498 &lt;/div&gt;.
       
  1499     </strong>
       
  1500   </p>
       
  1501 
       
  1502   </div>
       
  1503 </div>
       
  1504 
       
  1505 </p><!-- 
       
  1506 Pre-expand include size: 56186 bytes
       
  1507 Post-expand include size: 95609 bytes
       
  1508 Template argument size: 57003 bytes
       
  1509 Maximum: 2097152 bytes
       
  1510 -->
       
  1511 
       
  1512 <!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3777-1!1!0!!en!2 and timestamp 20100421093105 -->