The method that you use to create a new tabs interface.
Arguments:
| options (Optional) | Options | |
|---|---|---|
| A set of key/value pairs that configures the tabs interface. All options are optional. | ||
Options:
| Name | Type | |||||||
|---|---|---|---|---|---|---|---|---|
| selected | Number | Default: 0 | ||||||
| Zero-based index of the tab to be selected on initialization. To set all tabs to unselected set this option to null. | ||||||||
| unselect | Boolean | Default: false | ||||||
| Whether or not to hide an already selected tab on click. | ||||||||
| event | String | Default: click | ||||||
| The type of event to be used for selecting a tab. | ||||||||
| disabled | Array<Number> | Default: [] | ||||||
| An array containing the position of the tabs (zero-based index) that should be disabled on initialization. | ||||||||
| cookie | Object | |||||||
| Store the latest active (clicked) tab in a cookie. The cookie is used to determine the active tab on the next page load. Requires cookie plugin. The object needs to have key/value pairs of the form the cookie plugin expects as options. Available options: { expires: 7, path: '/', domain: 'jquery.com', secure: true } | ||||||||
| spinner | String | Default: Loading… | ||||||
| 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. | ||||||||
| cache | Boolean | Default: false | ||||||
| Wether 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. | ||||||||
| ajaxOptions | Options | |||||||
| Additional Ajax options to consider when loading tab content (see $.ajax). | ||||||||
Make synchronous requests when loading tab content.
$('.selector').tabs({ ajaxOptions: { async: false } }); idPrefix | String | Default: ui-tabs- | 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". | | ||||
| fx | Options, Array<Options> | |||||||
| 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"). | ||||||||
| tabTemplate | String | Default: <li><a href="#{href}"><span>#{label}</span></a></li> | ||||||
| HTML template from which a new tab is created and added. The placeholders #{href} and #{label} are replaced with the url and tab label that are passed as arguments to the add method. | ||||||||
| panelTemplate | String | Default: <div></div> | ||||||
| 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. | ||||||||
| select | function(event,ui) | |||||||
| Function that gets called when clicking a tab. | ||||||||
| load | function(event,ui) | |||||||
| Function that gets called after the content of a remote tab has been loaded. | ||||||||
| show | function(event,ui) | |||||||
| Function that gets called when a tab is shown. | ||||||||
| add | function(event,ui) | |||||||
| Function that gets called when a tab was added. | ||||||||
| remove | function(event,ui) | |||||||
| Function that gets called when a tab was removed. | ||||||||
| enable | function(event,ui) | |||||||
| Function that gets called when a tab was enabled. | ||||||||
| disable | function(event,ui) | |||||||
| Function that gets called when a tab was disabled. | ||||||||
Examples:
| Name | Type |
|---|
