Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 321 lines (320 sloc) 14.571 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
<?xml version="1.0"?>
<entry name="tabs" type="widget" animated-element="panel" widget-element="tabs container">
<title>Tabs Widget</title>
<desc>A single content area with multiple panels, each associated with a header in a list.</desc>
<longdesc>
<p>Tabs are generally used to break content into multiple sections that can be swapped to save space, much like an accordion.</p>

<p>The content for each tab panel can be defined in-page or can be loaded via Ajax; both are handled automatically based on the <code>href</code> of the anchor associated with the tab. By default tabs are activated on click, but the events can be changed to hover via the <a href="#option-event"><code>event</code></a> option.</p>
</longdesc>
<note id="functional-css"/>
<added>1.0</added>
<options>
<option name="ajaxOptions" type="Object" default="null">
<desc>Additional Ajax options to consider when loading tab content (see <a href="http://api.jquery.com/jQuery.ajax/"><code>jQuery.ajax()</code></a>).</desc>
</option>
<option name="cache" type="Boolean" default="false">
<desc>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 <code>cache: false</code> flag in the <a href="#option-ajaxOptions"><code>ajaxOptions</code></a> option.</desc>
</option>
<option name="collapsible" type="Boolean" default="false">
<desc>When set to <code>true</code>, the active panel can be closed.</desc>
</option>
<option name="cookie" type="Object" default="null">
<desc>Store the latest selected tab in a cookie. The cookie is then used to determine the initially selected tab if the <a href="#option-selected"><code>selected</code></a> option is not defined. Requires the cookie plugin, which can also be found in the development-bundle-external folder from the download builder. The object needs to have key/value pairs of the form the cookie plugin expects as options. Example: <code>{ expires 7, path: "/", domain: "jquerycom", secure: true }</code>. Since jQuery UI 1.7 it is also possible to define the cookie name being used via the <code>name</code> property.</desc>
</option>
<option name="disabled" default="false">
<desc>Which tabs are disabled.</desc>
<type name="Boolean">
<desc>Enable or disable all tabs.</desc>
</type>
<type name="Array">
<desc>An array containing the zero-based indexes of the tabs that should be disabled, e.g., <code>[ 0, 2 ]</code> would disable the first and third tab.</desc>
</type>
</option>
<option name="event" type="String" default='"click"'>
<desc>The type of event that the tabs should react to in order to activate the tab. To activate on hover, use <code>"mouseover"</code>.</desc>
</option>
<option name="fx" default="null">
<desc>Enable animations for hidniga nd showing tab panels.</desc>
<type name="Object">
<desc>Key/value pairs of properties to animate and optional duration, e.g., <code>{ height: "toggle", duration: 200 }</code>.</desc>
</type>
<type name="Array">
<desc>Animation settings in the form <code>[ hideSettings, showSettings ]</code>.</desc>
</type>
</option>
<option name="idPrefix" type="String" default='"ui-tabs-"'>
<desc>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, for example <code>"ui-tabs-54"</code>.</desc>
</option>
<option name="panelTemplate" type="String" default='"&lt;div>&lt;/div>"'>
<desc>HTML template from which a new tab panel is created in case of adding a tab with the <a href="#method-add"><code>add()</code></a> method or when creating a panel for a remote tab on the fly.</desc>
</option>
<option name="selected" default="0">
<desc>
Which panel is currently open.
</desc>
<type name="Boolean">
<desc>Setting <code>selected</code> to <code>false</code> will collapse all panels. This requires the <a href="#option-collapsible"><code>collapsible</code></a> option to be <code>true</code>.</desc>
</type>
<type name="Integer">
<desc>The zero-based index of the panel that is selected (open).</desc>
</type>
</option>
<option name="spinner" type="String" default='"&lt;em>Loading&amp;#8230;&lt;/em>"'>
<desc>The HTML content to show in a tab title while remote content is loading. Set this option to an empty string to deactivate the spinner behavior. A span element must be present in the anchor tag of the title for the spinner content to be visible.</desc>
</option>
<option name="tabTemplate" type="String" default='"&lt;li>&lt;a href="#{href}">&lt;span>#{label}&lt;/span>&lt;/a>&lt;/li>"'>
<desc>HTML template from which a new tab is created and added. The placeholders <code>#{href}</code> and <code>#{label}</code> are replaced with the URL and tab label that are passed as arguments to the <a href="#method-add"><code>add()</code></a> method.</desc>
</option>
</options>
<events>
<event name="create">
<desc>Triggered when the tabs are created.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object"/>
</event>
<event name="add">
<desc>Triggered when a tab is added.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that is being added.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that is being added.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
<event name="disable">
<desc>Triggered when a tab is disabled.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that is being disabled.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that is being disabled.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
<event name="enable">
<desc>Triggered when a tab is enabled.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that is being enabled.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that is being enabled.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
<event name="load" type="tabsload">
<desc>Triggered after a remote tab has been loaded.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="jQuery">
<desc>The tab that was just loaded.</desc>
</property>
<property name="panel" type="jQuery">
<desc>The panel which was just populated by the Ajax response.</desc>
</property>
</argument>
</event>
<event name="remove">
<desc>Triggered when a tab is removed.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that is being removed.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that is being removed.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
<event name="select" type="tabsselect">
<desc>Triggered directly after a tab is selected. Can be canceled to prevent the tab from being selected.</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that is about to be selected.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that is about to be selected.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
<event name="show" type="tabsshow">
<desc>Triggered after a tab has been selected (after animation completes).</desc>
<argument name="event" type="Event"/>
<argument name="ui" type="Object">
<property name="tab" type="Element">
<desc>The tab that was just selected.</desc>
</property>
<property name="panel" type="Element">
<desc>The panel that was just selected.</desc>
</property>
<property name="index" type="Integer">
<desc>The zero-based index of the tab.</desc>
</property>
</argument>
</event>
</events>
<methods>
<method name="abort">
<desc>Terminate all running tab ajax requests and animations.</desc>
</method>
<method name="add">
<desc>Add a tab.</desc>
<argument name="url" type="String">
<desc>The URL of the tab to add.</desc>
</argument>
<argument name="label" type="String">
<desc>The name of the tab to add.</desc>
</argument>
<argument name="index" type="Number" optional="true">
<desc>Where to add the new tab (zero-based). If omitted, the new tab will be added as the last tab.</desc>
</argument>
</method>
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="disable">
<signature>
<desc>Disables all tabs.</desc>
</signature>
<signature>
<desc>
Disables a tab. The selected tab cannot be disabled. To disable more than one tab at once, set the <a href="#option-disabled"><code>disabled</code></a> option: <code>$( "#tabs" ).tabs( "option", "disabled", [ 1, 2, 3 ] )</code>.
</desc>
<argument name="index">
<desc>Which tab to disable.</desc>
<type name="Number">
<desc>The zero-based index of the tab to disable.</desc>
</type>
<type name="String">
<desc>The <code>href</code> of the tab to disable.</desc>
</type>
</argument>
</signature>
</method>
<method name="enable">
<signature>
<desc>Enables all tabs.</desc>
</signature>
<signature>
<desc>Enables a tab. To enable more than one tab at once reset the disabled property like: <code>$( "#example" ).tabs( "option", "disabled", [] );</code>.</desc>
<argument name="index">
<desc>Which tab to enable.</desc>
<type name="Number">
<desc>The zero-based index of the tab to enable.</desc>
</type>
<type name="String">
<desc>The <code>href</code> of the tab to enable.</desc>
</type>
</argument>
</signature>
</method>
<method name="length" return="Integer">
<desc>Retrieve the number of tabs of the first matched tab pane.</desc>
</method>
<method name="load">
<desc>Loads the panel content of a remote tab.</desc>
<argument name="index">
<desc>Which tab to load.</desc>
<type name="Number">
<desc>The zero-based index of the tab to load.</desc>
</type>
<type name="String">
<desc>The <code>href</code> of the tab to load.</desc>
</type>
</argument>
</method>
<method name="remove">
<desc>Remove a tab.</desc>
<argument name="index">
<desc>Which tab to remove.</desc>
<type name="Number">
<desc>The zero-based index of the tab to remove.</desc>
</type>
<type name="String">
<desc>The <code>href</code> of the tab to remove.</desc>
</type>
</argument>
</method>
<method name="rotate">
<desc>Set up an automation rotation through the tabs.</desc>
<argument name="duration" type="Number">
<desc>The duration in milliseconds for each tab to be visible before rotating to the next tab.</desc>
</argument>
<argument name="continuing" type="Boolean" default="false" optional="true">
<desc>Whether or not to continue the rotation after a tab has been selected by a user.</desc>
</argument>
</method>
<method name="select">
<desc>Select a tab, as if it were clicked.</desc>
<argument name="index">
<desc>Which tab to select.</desc>
<type name="Number">
<desc>The zero-based index of the tab to load.</desc>
</type>
<type name="String">
<desc>The <code>href</code> of the tab to load.</desc>
</type>
</argument>
</method>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="url">
<desc>Change the URL from whcih 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.</desc>
<argument name="index" type="Integer">
<desc>The zero-based index of the tab to update.</desc>
</argument>
<argument name="url" type="String">
<desc>The URL to set for the tab.</desc>
</argument>
</method>
<xi:include href="../includes/widget-method-widget.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</methods>
<example>
<desc>A simple jQuery UI Tabs</desc>
<code><![CDATA[
$( "#tabs" ).tabs();
]]></code>
<html><![CDATA[
<div id="tabs">
<ul>
<li><a href="#fragment-1"><span>One</span></a></li>
<li><a href="#fragment-2"><span>Two</span></a></li>
<li><a href="#fragment-3"><span>Three</span></a></li>
</ul>
<div id="fragment-1">
<p>First tab is active by default:</p>
<pre><code>$( "#tabs" ).tabs(); </code></pre>
</div>
<div id="fragment-2">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
<div id="fragment-3">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
</div>
]]></html>
</example>
<category slug="widgets"/>
</entry>
Something went wrong with that request. Please try again.