Added my gui version
[matches/MCTX3420.git] / testing / ver0.01 / jquery-ui-1.10.3.custom / development-bundle / docs / jQuery.widget.html
1 <!doctype html>
2 <html lang="en">
3 <head>
4         <meta charset="utf-8">
5         <title>jQuery UI jQuery documentation</title>
6
7         <style>
8         body {
9                 font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"
10         }
11         .gutter {
12                 display: none;
13         }
14         </style>
15 </head>
16 <body>
17
18 <script>{
19                 "title":
20                         "Widget Factory",
21                 "excerpt":
22                         "Create stateful jQuery plugins using the same abstraction as all jQuery UI widgets.",
23                 "termSlugs": {
24                         "category": [
25                                 "utilities","utilities","widgets"
26                         ]
27                 }
28         }</script><div class="toc">
29 <h4><span>Contents:</span></h4>
30 <ul class="toc-list">
31 <li>
32 <a href="#jQuery-widget1">jQuery.widget( name [, base ], prototype )</a><ul><li>jQuery.widget( name [, base ], prototype )</li></ul>
33 </li>
34 <li><a href="#jQuery-Widget2">jQuery.Widget</a></li>
35 </ul>
36 </div><article id="jQuery-widget1" class="entry method"><h2 class="section-title"><span class="name">jQuery.widget( name [, base ], prototype )</span></h2>
37 <div class="entry-wrapper">
38 <p class="desc"><strong>Description: </strong>Create stateful jQuery plugins using the same abstraction as all jQuery UI widgets.</p>
39 <ul class="signatures"><li class="signature" id="jQuery-widget-name-base-prototype">
40 <h4 class="name">jQuery.widget( name [, base ], prototype )</h4>
41 <ul>
42 <li>
43 <div><strong>name</strong></div>
44 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
45 </div>
46 <div>The name of the widget to create, including the namespace.</div>
47 </li>
48 <li>
49 <div><strong>base</strong></div>
50 <div>Type: <a href="http://api.jquery.com/Types/#Function">Function</a>()</div>
51 <div>The base widget to inherit from. This must be a constructor that can be instantiated with the `new` keyword. Defaults to <code>jQuery.Widget</code>.</div>
52 </li>
53 <li>
54 <div><strong>prototype</strong></div>
55 <div>Type: <a href="http://api.jquery.com/Types#PlainObject">PlainObject</a>
56 </div>
57 <div>The object to use as a prototype for the widget.</div>
58 </li>
59 </ul>
60 </li></ul>
61 <div class="longdesc" id="entry-longdesc">
62                         <p>You can create new widgets from scratch, using just the <code>$.Widget</code> object as a base to inherit from, or you can explicitly inherit from existing jQuery UI or third-party widgets. Defining a widget with the same name as you inherit from even allows you to extend widgets in place.</p>
63
64                         <p>jQuery UI contains many widgets that maintain state and therefore have a slightly different usage pattern than typical jQuery plugins. All of jQuery UI's widgets use the same patterns, which is defined by the widget factory. So if you learn how to use one widget, then you'll know how to use all of them.</p>
65
66                         <p><em>Note: This documentation shows examples using the <a href="/progressbar">progressbar widget</a> but the syntax is the same for every widget.</em></p>
67
68                         <h3>Initialization</h3>
69
70                         <p>In order to track the state of the widget, we must introduce a full life cycle for the widget. The life cycle starts when the widget is initalized. To initialize a widget, we simply call the plugin on one or more elements.</p>
71
72                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).progressbar();</code></div></div></td></tr></tbody></table></div>
73
74                         <p>This will initialize each element in the jQuery object, in this case the element with an id of <code>"elem"</code>. Because we called the <code>progressbar()</code> method with no parameters, the widget is initialized with its default options. We can pass a set of options during initialization in order to override the default options.</p>
75
76                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).progressbar({ value: 20 });</code></div></div></td></tr></tbody></table></div>
77
78                         <p>We can pass as many or as few options as we want during initialization. Any options that we don't pass will just use their default values.</p>
79
80                         <p>The options are part of the widget's state, so we can set options after initialization as well. We'll see this later with the option method.</p>
81
82                         <h3>Methods</h3>
83
84                         <p>Now that the widget is initialized, we can query its state or perform actions on the widget. All actions after initialization take the form of a method call. To call a method on a widget, we pass the name of the method to the jQuery plugin. For example, to call the <code>value()</code> method on our progressbar widget, we would use:</p>
85
86                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).progressbar( </code><code class="string">"value"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
87
88                         <p>If the method accepts parameters, we can pass them after the method name. For example, to pass the parameter <code>40</code> to the <code>value()</code> method, we can use:</p>
89
90                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).progressbar( </code><code class="string">"value"</code><code class="plain">, 40 );</code></div></div></td></tr></tbody></table></div>
91
92                         <p>Just like other methods in jQuery, most widget methods return the jQuery object for chaining.</p>
93
94                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">)</code></div><div class="line number2 index1 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">.progressbar( </code><code class="string">"value"</code><code class="plain">, 90 )</code></div><div class="line number3 index2 alt2"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">.addClass( </code><code class="string">"almost-done"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
95
96                         <p>Each widget will have its own set of methods based on the functionality that the widget provides. However, there are a few methods that exist on all widgets, which are documented below.</p>
97
98                         <h3>Events</h3>
99
100                         <p>All widgets have events associated with their various behaviors to notify you when the state is changing. For most widgets, when the events are triggered, the names are prefixed with the widget name. For example, we can bind to progressbar's <code>change</code> event which is triggered whenever the value changes.</p>
101
102                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).bind( </code><code class="string">"progressbarchange"</code><code class="plain">, </code><code class="keyword">function</code><code class="plain">() {</code></div><div class="line number2 index1 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">alert( </code><code class="string">"The value has changed!"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2"><code class="plain">});</code></div></div></td></tr></tbody></table></div>
103
104                         <p>Each event has a corresponding callback, which is exposed as an option. We can hook into progressbar's <code>change</code> callback instead of binding to the <code>progressbarchange</code> event, if we want to.</p>
105
106                         <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">"#elem"</code> <code class="plain">).progressbar({</code></div><div class="line number2 index1 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">change: </code><code class="keyword">function</code><code class="plain">() {</code></div><div class="line number3 index2 alt2"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">alert( </code><code class="string">"The value has changed!"</code> <code class="plain">);</code></div><div class="line number4 index3 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">}</code></div><div class="line number5 index4 alt2"><code class="plain">});</code></div></div></td></tr></tbody></table></div>
107
108                         <p>All widgets have a <code>create</code> event which is triggered upon instantiation.</p>
109                 </div>
110 </div></article><article id="jQuery-Widget2" class="entry widget"><h2 class="section-title"><span>Base Widget</span></h2>
111 <div class="entry-wrapper">
112 <p class="desc"><strong>Description: </strong>The base widget used by the widget factory.</p>
113 <section id="quick-nav"><header><h2>QuickNav</h2></header><div class="quick-nav-section">
114 <h3>Options</h3>
115 <div><a href="#option-disabled">disabled</a></div>
116 <div><a href="#option-hide">hide</a></div>
117 <div><a href="#option-show">show</a></div>
118 </div>
119 <div class="quick-nav-section">
120 <h3>Methods</h3>
121 <div><a href="#method-destroy">destroy</a></div>
122 <div><a href="#method-disable">disable</a></div>
123 <div><a href="#method-enable">enable</a></div>
124 <div><a href="#method-option">option</a></div>
125 <div><a href="#method-widget">widget</a></div>
126 <div><a href="#method-_create">_create</a></div>
127 <div><a href="#method-_destroy">_destroy</a></div>
128 <div><a href="#method-_getCreateEventData">_getCreateEventData</a></div>
129 <div><a href="#method-_getCreateOptions">_getCreateOptions</a></div>
130 <div><a href="#method-_init">_init</a></div>
131 <div><a href="#method-_setOptions">_setOptions</a></div>
132 <div><a href="#method-_setOption">_setOption</a></div>
133 <div><a href="#method-_on">_on</a></div>
134 <div><a href="#method-_off">_off</a></div>
135 <div><a href="#method-_super">_super</a></div>
136 <div><a href="#method-_superApply">_superApply</a></div>
137 <div><a href="#method-_delay">_delay</a></div>
138 <div><a href="#method-_hoverable">_hoverable</a></div>
139 <div><a href="#method-_focusable">_focusable</a></div>
140 <div><a href="#method-_trigger">_trigger</a></div>
141 <div><a href="#method-_show">_show</a></div>
142 <div><a href="#method-_hide">_hide</a></div>
143 </div>
144 <div class="quick-nav-section">
145 <h3>Events</h3>
146 <div><a href="#event-create">create</a></div>
147 </div></section><section id="options"><header><h2 class="underline">Options</h2></header><div id="option-disabled" class="api-item first-item">
148 <h3>disabled<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a></span>
149 </h3>
150 <div class="default">
151 <strong>Default: </strong><code>false</code>
152 </div>
153 <div>Disables the jQuery.Widget if set to <code>true</code>.</div>
154 <strong>Code examples:</strong><p>Initialize the jQuery.Widget with the disabled option specified:</p>
155 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget({ disabled: </code><code class="keyword">true</code> <code class="plain">});</code></div></div></td></tr></tbody></table></div>
156 <p>Get or set the disabled option, after initialization:</p>
157 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">disabled = $( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2">&nbsp;</div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code><code class="plain">, </code><code class="keyword">true</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
158 </div>
159 <div id="option-hide" class="api-item">
160 <h3>hide<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a> or <a href="http://api.jquery.com/Types#Number">Number</a> or <a href="http://api.jquery.com/Types#String">String</a> or <a href="http://api.jquery.com/Types#Object">Object</a></span>
161 </h3>
162 <div class="default">
163 <strong>Default: </strong><code>null</code>
164 </div>
165 <div>If and how to animate the hiding of the element.</div>
166 <strong>Multiple types supported:</strong><ul>
167 <li>
168 <strong>Boolean</strong>: 
169                         When set to <code>false</code>, no animation will be used and the element will be hidden immediately.
170                         When set to <code>true</code>, the element will fade out with the default duration and the default easing.
171                 </li>
172 <li>
173 <strong>Number</strong>: 
174                         The element will fade out with the specified duration and the default easing.
175                 </li>
176 <li>
177 <strong>String</strong>: 
178                         The element will be hidden using the specified effect.
179                         The value can either be the name of a built-in jQuery animateion method, such as <code>"slideUp"</code>, or the name of a jQuery UI effect, such as <code>"fold"</code>.
180                         In either case the effect will be used with the default duration and the default easing.
181                 </li>
182 <li>
183 <strong>Object</strong>: If the value is an object, then <code>effect</code>, <code>duration</code>, and <code>easing</code> properties may be provided. If the <code>effect</code> property contains the name of a jQuery method, then that method will be used; otherwise it is assumed to be the name of a jQuery UI effect. When using a jQuery UI effect that supports additional settings, you may include those settings in the object and they will be passed to the effect. If <code>duration</code> or <code>easing</code> is omitted, then the default values will be used. If <code>effect</code> is omitted, then <code>"fadeOut"</code> will be used.</li>
184 </ul>
185 <strong>Code examples:</strong><p>Initialize the jQuery.Widget with the hide option specified:</p>
186 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget({ hide: { effect: </code><code class="string">"explode"</code><code class="plain">, duration: 1000 } });</code></div></div></td></tr></tbody></table></div>
187 <p>Get or set the hide option, after initialization:</p>
188 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">hide = $( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"hide"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2">&nbsp;</div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"hide"</code><code class="plain">, { effect: </code><code class="string">"explode"</code><code class="plain">, duration: 1000 } );</code></div></div></td></tr></tbody></table></div>
189 </div>
190 <div id="option-show" class="api-item">
191 <h3>show<span class="option-type"><strong>Type: </strong><a href="http://api.jquery.com/Types#Boolean">Boolean</a> or <a href="http://api.jquery.com/Types#Number">Number</a> or <a href="http://api.jquery.com/Types#String">String</a> or <a href="http://api.jquery.com/Types#Object">Object</a></span>
192 </h3>
193 <div class="default">
194 <strong>Default: </strong><code>null</code>
195 </div>
196 <div>If and how to animate the showing of the element.</div>
197 <strong>Multiple types supported:</strong><ul>
198 <li>
199 <strong>Boolean</strong>: 
200                         When set to <code>false</code>, no animation will be used and the element will be shown immediately.
201                         When set to <code>true</code>, the element will fade in with the default duration and the default easing.
202                 </li>
203 <li>
204 <strong>Number</strong>: 
205                         The element will fade in with the specified duration and the default easing.
206                 </li>
207 <li>
208 <strong>String</strong>: 
209                         The element will be shown using the specified effect.
210                         The value can either be the name of a built-in jQuery animateion method, such as <code>"slideDown"</code>, or the name of a jQuery UI effect, such as <code>"fold"</code>.
211                         In either case the effect will be used with the default duration and the default easing.
212                 </li>
213 <li>
214 <strong>Object</strong>: If the value is an object, then <code>effect</code>, <code>duration</code>, and <code>easing</code> properties may be provided. If the <code>effect</code> property contains the name of a jQuery method, then that method will be used; otherwise it is assumed to be the name of a jQuery UI effect. When using a jQuery UI effect that supports additional settings, you may include those settings in the object and they will be passed to the effect. If <code>duration</code> or <code>easing</code> is omitted, then the default values will be used. If <code>effect</code> is omitted, then <code>"fadeIn"</code> will be used.</li>
215 </ul>
216 <strong>Code examples:</strong><p>Initialize the jQuery.Widget with the show option specified:</p>
217 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget({ show: { effect: </code><code class="string">"blind"</code><code class="plain">, duration: 800 } });</code></div></div></td></tr></tbody></table></div>
218 <p>Get or set the show option, after initialization:</p>
219 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="comments">// getter</code></div><div class="line number2 index1 alt1"><code class="keyword">var</code> <code class="plain">show = $( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"show"</code> <code class="plain">);</code></div><div class="line number3 index2 alt2">&nbsp;</div><div class="line number4 index3 alt1"><code class="comments">// setter</code></div><div class="line number5 index4 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"show"</code><code class="plain">, { effect: </code><code class="string">"blind"</code><code class="plain">, duration: 800 } );</code></div></div></td></tr></tbody></table></div>
220 </div></section><section id="methods"><header><h2 class="underline">Methods</h2></header><div id="method-_create"><div class="api-item first-item">
221 <h3>_create()</h3>
222 <div>
223                                         The <code>_create()</code> method is the widget's constructor.
224                                         There are no parameters, but <code>this.element</code> and <code>this.options</code> are already set.
225                                 </div>
226 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
227 </div></div>
228 <div id="method-_delay"><div class="api-item">
229 <h3>_delay( fn [, delay ] )<span class="returns">Returns: <a href="http://api.jquery.com/Types#Number">Number</a></span>
230 </h3>
231 <div>
232                                         Invokes the provided function after a specified delay. Keeps <code>this</code> context correct. Essentially <code>setTimeout()</code>.
233                                         <p>Returns the timeout ID for use with <code>clearTimeout()</code>.</p>
234                                 </div>
235 <ul>
236 <li>
237 <div><strong>fn</strong></div>
238 <div>Type: <a href="http://api.jquery.com/Types/#Function">Function</a>() or <a href="http://api.jquery.com/Types#String">String</a>
239 </div>
240 <div>The function to invoke. Can also be the name of a method on the widget.</div>
241 </li>
242 <li>
243 <div><strong>delay</strong></div>
244 <div>Type: <a href="http://api.jquery.com/Types#Number">Number</a>
245 </div>
246 <div>The number of milliseconds to wait before invoking the function. Deafults to <code>0</code>.</div>
247 </li>
248 </ul>
249 </div></div>
250 <div id="method-_destroy"><div class="api-item">
251 <h3>_destroy()</h3>
252 <div>
253                                         The public <a href="#method-destroy"><code>destroy()</code></a> method cleans up all common data, events, etc. and then delegates out to <code>_destroy()</code> for custom, widget-specific, cleanup.
254                                 </div>
255 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
256 </div></div>
257 <div id="method-_focusable"><div class="api-item">
258 <h3>_focusable( element )</h3>
259 <div>
260                                         Sets up <code>element</code> to apply the <code>ui-state-focus</code> class on focus.
261                                         <p>The event handlers are automatically cleaned up on destroy.</p>
262                                 </div>
263 <ul><li>
264 <div><strong>element</strong></div>
265 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
266 </div>
267 <div>The element(s) to apply the focusable behavior to.</div>
268 </li></ul>
269 </div></div>
270 <div id="method-_getCreateEventData"><div class="api-item">
271 <h3>_getCreateEventData()<span class="returns">Returns: <a href="http://api.jquery.com/Types#Object">Object</a></span>
272 </h3>
273 <div>
274                                         All widgets trigger the <a href="#event-create"><code>create</code></a> event. By default, no data is provided in the event, but this method can return an object which will be passed as the <code>create</code> event's data.
275                                 </div>
276 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
277 </div></div>
278 <div id="method-_getCreateOptions"><div class="api-item">
279 <h3>_getCreateOptions()<span class="returns">Returns: <a href="http://api.jquery.com/Types#Object">Object</a></span>
280 </h3>
281 <div>
282                                         This method allows the widget to define a custom method for defining options during instantiation. This user-provided options override the options returned by this method which override the default options.
283                                 </div>
284 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
285 </div></div>
286 <div id="method-_hide"><div class="api-item">
287 <h3>_hide( element, option [, callback ] )</h3>
288 <div>
289                                         Hides an element immediately, using built-in animation methods, or using custom effects.
290                                         See the <a href="#option-hide">hide</a> option for possible <code>option</code> values.
291                                 </div>
292 <ul>
293 <li>
294 <div><strong>element</strong></div>
295 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
296 </div>
297 <div>The element(s) to hide.</div>
298 </li>
299 <li>
300 <div><strong>option</strong></div>
301 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
302 </div>
303 <div>The settings defining how to hide the element.</div>
304 </li>
305 <li>
306 <div><strong>callback</strong></div>
307 <div>Type: <a href="http://api.jquery.com/Types/#Function">Function</a>()</div>
308 <div>Callback to invoke after the element has been fully hidden.</div>
309 </li>
310 </ul>
311 </div></div>
312 <div id="method-_hoverable"><div class="api-item">
313 <h3>_hoverable( element )</h3>
314 <div>
315                                         Sets up <code>element</code> to apply the <code>ui-state-hover</code> class on hover.
316                                         <p>The event handlers are automatically cleaned up on destroy.</p>
317                                 </div>
318 <ul><li>
319 <div><strong>element</strong></div>
320 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
321 </div>
322 <div>The element(s) to apply the hoverable behavior to.</div>
323 </li></ul>
324 </div></div>
325 <div id="method-_init"><div class="api-item">
326 <h3>_init()</h3>
327 <div>
328                                         Widgets have the concept of initialization that is distinct from creation. Any time the plugin is called with no arguments or with only an option hash, the widget is initialized; this includes when the widget is created.
329
330                                         <p><em>Note: Initialization should only be handled if there is a logical action to perform on successive calls to the widget with no arguments.</em></p>
331                                 </div>
332 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
333 </div></div>
334 <div id="method-_off"><div class="api-item">
335 <h3>_off( element, eventName )</h3>
336 <div>
337                                         Unbinds event handlers from the specified element(s).
338                                 </div>
339 <ul>
340 <li>
341 <div><strong>element</strong></div>
342 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
343 </div>
344 <div>
345                                                 The element(s) to unbind the event handlers from. Unlike the <code>_on()</code> method, the elements are required for <code>_off()</code>.
346                                         </div>
347 </li>
348 <li>
349 <div><strong>eventName</strong></div>
350 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
351 </div>
352 <div>One or more space-separated event types.</div>
353 </li>
354 </ul>
355 </div></div>
356 <div id="method-_on"><div class="api-item">
357 <h3>_on(  [element ], handlers )</h3>
358 <div>
359                                         Binds event handlers to the specified element(s). Delegation is supported via selectors inside the event names, e.g., "<code>click .foo</code>". The <code>_on()</code> method provides several benefits of direct event binding:
360                                         <ul>
361                                                 <li>Maintains proper <code>this</code> context inside the handlers.</li>
362                                                 <li>Automatically handles disabled widgets: If the widget is disabled or the event occurs on an element with the <code>ui-state-disabled</code> class, the event handler is not invoked.</li>
363                                                 <li>Event handlers are automatically namespaced and cleaned up on destroy.</li>
364                                         </ul>
365                                 </div>
366 <ul>
367 <li>
368 <div><strong>element</strong></div>
369 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
370 </div>
371 <div>Which element(s) to bind the event handlers to. If no element is provided, <code>this.element</code> is used.</div>
372 </li>
373 <li>
374 <div><strong>handlers</strong></div>
375 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
376 </div>
377 <div>
378                                                 A map in which the string keys represent the event type and optional selector for delegation, and the values represent a handler function to be called for the event.
379                                         </div>
380 </li>
381 </ul>
382 </div></div>
383 <div id="method-_setOption"><div class="api-item">
384 <h3>_setOption( key, value )</h3>
385 <div>
386                                         Called from the <a href="#method-_setOptions"><code>_setOptions()</code></a> method for each individual option. Widget state should be updated based on changes.
387                                 </div>
388 <ul>
389 <li>
390 <div><strong>key</strong></div>
391 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
392 </div>
393 <div>The name of the option to set.</div>
394 </li>
395 <li>
396 <div><strong>value</strong></div>
397 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
398 </div>
399 <div>A value to set for the option.</div>
400 </li>
401 </ul>
402 </div></div>
403 <div id="method-_setOptions"><div class="api-item">
404 <h3>_setOptions( options )</h3>
405 <div>
406                                         Called whenever the <a href="#method-option"><code>option()</code></a> method is called, regardless of the form in which the <code>option()</code> method was called.
407                                         <p>Overriding this is useful if you can defer processor-intensive changes for multiple option changes.</p>
408                                 </div>
409 <ul><li>
410 <div><strong>options</strong></div>
411 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
412 </div>
413 <div>A map of option-value pairs to set.</div>
414 </li></ul>
415 </div></div>
416 <div id="method-_show"><div class="api-item">
417 <h3>_show( element, option [, callback ] )</h3>
418 <div>
419                                         Shows an element immediately, using built-in animation methods, or using custom effects.
420                                         See the <a href="#option-show">show</a> option for possible <code>option</code> values.
421                                 </div>
422 <ul>
423 <li>
424 <div><strong>element</strong></div>
425 <div>Type: <a href="http://api.jquery.com/Types#jQuery">jQuery</a>
426 </div>
427 <div>The element(s) to show.</div>
428 </li>
429 <li>
430 <div><strong>option</strong></div>
431 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
432 </div>
433 <div>The settings defining how to show the element.</div>
434 </li>
435 <li>
436 <div><strong>callback</strong></div>
437 <div>Type: <a href="http://api.jquery.com/Types/#Function">Function</a>()</div>
438 <div>Callback to invoke after the element has been fully shown.</div>
439 </li>
440 </ul>
441 </div></div>
442 <div id="method-_super"><div class="api-item">
443 <h3>_super()</h3>
444 <div>
445                                         Invokes the method of the same name from the parent widget, with any specified arguments. Essentially <code>.call()</code>.
446                                 </div>
447 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
448 </div></div>
449 <div id="method-_superApply"><div class="api-item">
450 <h3>_superApply( arguments )</h3>
451 <div>
452                                         Invokes the method of the same name from the parent widget, with the array of arguments. Essentially <code>.apply()</code>.
453                                 </div>
454 <ul><li>
455 <div><strong>arguments</strong></div>
456 <div>Type: <a href="http://api.jquery.com/Types#Array">Array</a>
457 </div>
458 <div>Array of arguments to pass to the parent method.</div>
459 </li></ul>
460 </div></div>
461 <div id="method-_trigger"><div class="api-item">
462 <h3>_trigger( type [, event ] [, data ] )</h3>
463 <div>
464                                         Triggers an event and its associated callback.
465                                         <p>The option with the name equal to type is invoked as the callback.</p>
466                                         <p>The event name is the widget name + type.</p>
467                                         <p><em>Note: When providing data, you must provide all three parameters. If there is no event to pass along, just pass <code>null</code>.</em></p>
468                                 </div>
469 <ul>
470 <li>
471 <div><strong>type</strong></div>
472 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
473 </div>
474 <div>The <code>type</code> should match the name of a callback option. The full event type will be generated automatically.</div>
475 </li>
476 <li>
477 <div><strong>event</strong></div>
478 <div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
479 </div>
480 <div>The original event that caused this event to occur; useful for providing context to the listener.</div>
481 </li>
482 <li>
483 <div><strong>data</strong></div>
484 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
485 </div>
486 <div>A hash of data associated with the event.</div>
487 </li>
488 </ul>
489 </div></div>
490 <div id="method-destroy"><div class="api-item">
491 <h3>destroy()</h3>
492 <div>
493                 Removes the jQuery.Widget functionality completely. This will return the element back to its pre-init state.
494         </div>
495 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
496 </div></div>
497 <div id="method-disable"><div class="api-item">
498 <h3>disable()</h3>
499 <div>
500                 Disables the jQuery.Widget.
501         </div>
502 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
503 </div></div>
504 <div id="method-enable"><div class="api-item">
505 <h3>enable()</h3>
506 <div>
507                 Enables the jQuery.Widget.
508         </div>
509 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
510 </div></div>
511 <div id="method-option">
512 <div class="api-item">
513 <h3>option( optionName )<span class="returns">Returns: <a href="http://api.jquery.com/Types#Object">Object</a></span>
514 </h3>
515 <div>Gets the value currently associated with the specified <code>optionName</code>.</div>
516 <ul><li>
517 <div><strong>optionName</strong></div>
518 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
519 </div>
520 <div>The name of the option to get.</div>
521 </li></ul>
522 <div>
523 <strong>Code examples:</strong><p>Invoke the  method:</p>
524 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="keyword">var</code> <code class="plain">isDisabled = $( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
525 </div>
526 </div>
527 <div class="api-item">
528 <h3>option()<span class="returns">Returns: <a href="http://api.jquery.com/Types#PlainObject">PlainObject</a></span>
529 </h3>
530 <div>Gets an object containing key/value pairs representing the current jQuery.Widget options hash.</div>
531 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
532 <div>
533 <strong>Code examples:</strong><p>Invoke the  method:</p>
534 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="keyword">var</code> <code class="plain">options = $( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
535 </div>
536 </div>
537 <div class="api-item">
538 <h3>option( optionName, value )</h3>
539 <div>Sets the value of the jQuery.Widget option associated with the specified <code>optionName</code>.</div>
540 <ul>
541 <li>
542 <div><strong>optionName</strong></div>
543 <div>Type: <a href="http://api.jquery.com/Types#String">String</a>
544 </div>
545 <div>The name of the option to set.</div>
546 </li>
547 <li>
548 <div><strong>value</strong></div>
549 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
550 </div>
551 <div>A value to set for the option.</div>
552 </li>
553 </ul>
554 <div>
555 <strong>Code examples:</strong><p>Invoke the  method:</p>
556 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, </code><code class="string">"disabled"</code><code class="plain">, </code><code class="keyword">true</code> <code class="plain">);</code></div></div></td></tr></tbody></table></div>
557 </div>
558 </div>
559 <div class="api-item">
560 <h3>option( options )</h3>
561 <div>Sets one or more options for the jQuery.Widget.</div>
562 <ul><li>
563 <div><strong>options</strong></div>
564 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
565 </div>
566 <div>A map of option-value pairs to set.</div>
567 </li></ul>
568 <div>
569 <strong>Code examples:</strong><p>Invoke the  method:</p>
570 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget( </code><code class="string">"option"</code><code class="plain">, { disabled: </code><code class="keyword">true</code> <code class="plain">} );</code></div></div></td></tr></tbody></table></div>
571 </div>
572 </div>
573 </div>
574 <div id="method-widget"><div class="api-item">
575 <h3>widget()<span class="returns">Returns: <a href="http://api.jquery.com/Types#jQuery">jQuery</a></span>
576 </h3>
577 <div>
578                 Returns a <code>jQuery</code> object containing the original element or other relevant generated element.
579         </div>
580 <ul><li><div class="null-signature">This method does not accept any arguments.</div></li></ul>
581 </div></div></section><section id="events"><header><h2 class="underline">Events</h2></header><div id="event-create" class="api-item first-item">
582 <h3>create( event, ui )<span class="returns">Type: <code>jQuery.Widgetcreate</code></span>
583 </h3>
584 <div>
585                 Triggered when the jQuery.Widget is created.
586         </div>
587 <ul>
588 <li>
589 <div><strong>event</strong></div>
590 <div>Type: <a href="http://api.jquery.com/Types#Event">Event</a>
591 </div>
592 <div></div>
593 </li>
594 <li>
595 <div><strong>ui</strong></div>
596 <div>Type: <a href="http://api.jquery.com/Types#Object">Object</a>
597 </div>
598 <div></div>
599 </li>
600 </ul>
601 <div>
602 <strong>Code examples:</strong><p>Initialize the jQuery.Widget with the create callback specified:</p>
603 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).jQuery.Widget({</code></div><div class="line number2 index1 alt1"><code class="undefined spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="plain">create: </code><code class="keyword">function</code><code class="plain">( event, ui ) {}</code></div><div class="line number3 index2 alt2"><code class="plain">});</code></div></div></td></tr></tbody></table></div>
604 <p>Bind an event listener to the jQuery.Widgetcreate event:</p>
605 <div class="syntaxhighlighter nogutter  "><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="plain">$( </code><code class="string">".selector"</code> <code class="plain">).on( </code><code class="string">"jQuery.Widgetcreate"</code><code class="plain">, </code><code class="keyword">function</code><code class="plain">( event, ui ) {} );</code></div></div></td></tr></tbody></table></div>
606 </div>
607 </div></section>
608 </div></article>
609
610 </body>
611 </html>

UCC git Repository :: git.ucc.asn.au