Project

General

Profile

1 5703 leinfelder
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 Progressbar</h1>
11
  <div id="overview">
12
    <h2 class="top-header">Overview</h2>
13
    <div id="overview-main">
14
        <p>
15
The progress bar is designed to simply display the current % complete for a process. The bar is coded to be flexibly sized through CSS and will scale to fit inside it's parent container by default.
16
</p>
17
<p>
18
This is a determinate progress bar, meaning that it should only be used in situations where the system can accurately update the current status complete. A determinate progress bar should never fill from left to right, then loop back to empty for a single process -- if the actual percent complete status cannot be calculated, an indeterminate progress bar (coming soon) or spinner animation is a better way to provide user feedback.
19
</p>
20
    </div>
21
    <div id="overview-dependencies">
22
        <h3>Dependencies</h3>
23
        <ul>
24
<li>UI Core</li>
25
</ul>
26
    </div>
27
    <div id="overview-example">
28
        <h3>Example</h3>
29
        <div id="overview-example" class="example">
30
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
31
<p><div id="demo" class="tabs-container" rel="100">
32
A simple jQuery UI Progressbar.<br />
33
</p>
34
<pre>$(&quot;#progressbar&quot;).progressbar({ value: 37 });
35
</pre>
36
<p></div><div id="source" class="tabs-container">
37
</p>
38
<pre>&lt;!DOCTYPE html&gt;
39
&lt;html&gt;
40
&lt;head&gt;
41
  &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;
42
  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&quot;&gt;&lt;/script&gt;
43
  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&quot;&gt;&lt;/script&gt;
44
45
  &lt;script&gt;
46
  $(document).ready(function() {
47
    $(&quot;#progressbar&quot;).progressbar({ value: 37 });
48
  });
49
  &lt;/script&gt;
50
&lt;/head&gt;
51
&lt;body style="font-size:62.5%;"&gt;
52
53
&lt;div id=&quot;progressbar&quot;&gt;&lt;/div&gt;
54
55
&lt;/body&gt;
56
&lt;/html&gt;
57
</pre>
58
<p></div>
59
</p><p></div>
60
    </div>
61
  </div>
62
  <div id="options">
63
    <h2 class="top-header">Options</h2>
64
    <ul class="options-list">
65
66
<li class="option" id="option-disabled">
67
  <div class="option-header">
68
    <h3 class="option-name"><a href="#option-disabled">disabled</a></h3>
69
    <dl>
70
      <dt class="option-type-label">Type:</dt>
71
        <dd class="option-type">Boolean</dd>
72
73
      <dt class="option-default-label">Default:</dt>
74
        <dd class="option-default">false</dd>
75
76
    </dl>
77
  </div>
78
  <div class="option-description">
79
    <p>Disables (true) or enables (false) the progressbar. Can be set when initialising (first creating) the progressbar.</p>
80
  </div>
81
  <div class="option-examples">
82
    <h4>Code examples</h4>
83
    <dl class="option-examples-list">
84
85
<dt>
86
  Initialize a progressbar with the <code>disabled</code> option specified.
87
</dt>
88
<dd>
89
<pre><code>$( ".selector" ).progressbar({ disabled: true });</code></pre>
90
</dd>
91
92
93
<dt>
94
  Get or set the <code>disabled</code> option, after init.
95
</dt>
96
<dd>
97
<pre><code>//getter
98
var disabled = $( ".selector" ).progressbar( "option", "disabled" );
99
//setter
100
$( ".selector" ).progressbar( "option", "disabled", true );</code></pre>
101
</dd>
102
103
    </dl>
104
  </div>
105
</li>
106
107
108
<li class="option" id="option-value">
109
  <div class="option-header">
110
    <h3 class="option-name"><a href="#option-value">value</a></h3>
111
    <dl>
112
      <dt class="option-type-label">Type:</dt>
113
        <dd class="option-type">Number</dd>
114
115
      <dt class="option-default-label">Default:</dt>
116
        <dd class="option-default">0</dd>
117
118
    </dl>
119
  </div>
120
  <div class="option-description">
121
    <p>The value of the progressbar.</p>
122
  </div>
123
  <div class="option-examples">
124
    <h4>Code examples</h4>
125
    <dl class="option-examples-list">
126
127
<dt>
128
  Initialize a progressbar with the <code>value</code> option specified.
129
</dt>
130
<dd>
131
<pre><code>$( ".selector" ).progressbar({ value: 37 });</code></pre>
132
</dd>
133
134
135
<dt>
136
  Get or set the <code>value</code> option, after init.
137
</dt>
138
<dd>
139
<pre><code>//getter
140
var value = $( ".selector" ).progressbar( "option", "value" );
141
//setter
142
$( ".selector" ).progressbar( "option", "value", 37 );</code></pre>
143
</dd>
144
145
    </dl>
146
  </div>
147
</li>
148
149
    </ul>
150
  </div>
151
  <div id="events">
152
    <h2 class="top-header">Events</h2>
153
    <ul class="events-list">
154
155
<li class="event" id="event-change">
156
  <div class="event-header">
157
    <h3 class="event-name"><a href="#event-change">change</a></h3>
158
    <dl>
159
      <dt class="event-type-label">Type:</dt>
160
        <dd class="event-type">progressbarchange</dd>
161
    </dl>
162
  </div>
163
  <div class="event-description">
164
    <p>This event is triggered when the value of the progressbar changes.</p>
165
  </div>
166
  <div class="event-examples">
167
    <h4>Code examples</h4>
168
    <dl class="event-examples-list">
169
170
<dt>
171
  Supply a callback function to handle the <code>change</code> event as an init option.
172
</dt>
173
<dd>
174
<pre><code>$( &quot;.selector&quot; ).progressbar({
175
   change: function(event, ui) { ... }
176
});</code></pre>
177
</dd>
178
179
180
<dt>
181
  Bind to the <code>change</code> event by type: <code>progressbarchange</code>.
182
</dt>
183
<dd>
184
<pre><code>$( &quot;.selector&quot; ).bind( &quot;progressbarchange&quot;, function(event, ui) {
185
  ...
186
});</code></pre>
187
</dd>
188
189
    </dl>
190
  </div>
191
</li>
192
193
194
<li class="event" id="event-complete">
195
  <div class="event-header">
196
    <h3 class="event-name"><a href="#event-complete">complete</a></h3>
197
    <dl>
198
      <dt class="event-type-label">Type:</dt>
199
        <dd class="event-type">progressbarcomplete</dd>
200
    </dl>
201
  </div>
202
  <div class="event-description">
203
    <p>This event is triggered when the value of the progressbar reaches the maximum value of 100.</p>
204
  </div>
205
  <div class="event-examples">
206
    <h4>Code examples</h4>
207
    <dl class="event-examples-list">
208
209
<dt>
210
  Supply a callback function to handle the <code>complete</code> event as an init option.
211
</dt>
212
<dd>
213
<pre><code>$( &quot;.selector&quot; ).progressbar({
214
   complete: function(event, ui) { ... }
215
});</code></pre>
216
</dd>
217
218
219
<dt>
220
  Bind to the <code>complete</code> event by type: <code>progressbarcomplete</code>.
221
</dt>
222
<dd>
223
<pre><code>$( &quot;.selector&quot; ).bind( &quot;progressbarcomplete&quot;, function(event, ui) {
224
  ...
225
});</code></pre>
226
</dd>
227
228
    </dl>
229
  </div>
230
</li>
231
232
    </ul>
233
  </div>
234
  <div id="methods">
235
    <h2 class="top-header">Methods</h2>
236
    <ul class="methods-list">
237
238
<li class="method" id="method-destroy">
239
  <div class="method-header">
240
    <h3 class="method-name"><a href="#method-destroy">destroy</a></h3>
241
    <dl>
242
      <dt class="method-signature-label">Signature:</dt>
243
        <dd class="method-signature">.progressbar( "destroy"
244
245
246
247
248
249
250
251
)</dd>
252
    </dl>
253
  </div>
254
  <div class="method-description">
255
    <p>Remove the progressbar functionality completely. This will return the element back to its pre-init state.</p>
256
  </div>
257
</li>
258
259
260
<li class="method" id="method-disable">
261
  <div class="method-header">
262
    <h3 class="method-name"><a href="#method-disable">disable</a></h3>
263
    <dl>
264
      <dt class="method-signature-label">Signature:</dt>
265
        <dd class="method-signature">.progressbar( "disable"
266
267
268
269
270
271
272
273
)</dd>
274
    </dl>
275
  </div>
276
  <div class="method-description">
277
    <p>Disable the progressbar.</p>
278
  </div>
279
</li>
280
281
282
<li class="method" id="method-enable">
283
  <div class="method-header">
284
    <h3 class="method-name"><a href="#method-enable">enable</a></h3>
285
    <dl>
286
      <dt class="method-signature-label">Signature:</dt>
287
        <dd class="method-signature">.progressbar( "enable"
288
289
290
291
292
293
294
295
)</dd>
296
    </dl>
297
  </div>
298
  <div class="method-description">
299
    <p>Enable the progressbar.</p>
300
  </div>
301
</li>
302
303
304
<li class="method" id="method-option">
305
  <div class="method-header">
306
    <h3 class="method-name"><a href="#method-option">option</a></h3>
307
    <dl>
308
      <dt class="method-signature-label">Signature:</dt>
309
        <dd class="method-signature">.progressbar( "option"
310
311
, optionName
312
313
, <span class="optional">[</span>value<span class="optional">] </span>
314
315
316
317
)</dd>
318
    </dl>
319
  </div>
320
  <div class="method-description">
321
    <p>Get or set any progressbar option. If no value is specified, will act as a getter.</p>
322
  </div>
323
</li>
324
325
326
<li class="method" id="method-option">
327
  <div class="method-header">
328
    <h3 class="method-name"><a href="#method-option">option</a></h3>
329
    <dl>
330
      <dt class="method-signature-label">Signature:</dt>
331
        <dd class="method-signature">.progressbar( "option"
332
333
, options
334
335
336
337
338
339
)</dd>
340
    </dl>
341
  </div>
342
  <div class="method-description">
343
    <p>Set multiple progressbar options at once by providing an options object.</p>
344
  </div>
345
</li>
346
347
348
<li class="method" id="method-widget">
349
  <div class="method-header">
350
    <h3 class="method-name"><a href="#method-widget">widget</a></h3>
351
    <dl>
352
      <dt class="method-signature-label">Signature:</dt>
353
        <dd class="method-signature">.progressbar( "widget"
354
355
356
357
358
359
360
361
)</dd>
362
    </dl>
363
  </div>
364
  <div class="method-description">
365
    <p>Returns the .ui-progressbar element.</p>
366
  </div>
367
</li>
368
369
370
<li class="method" id="method-value">
371
  <div class="method-header">
372
    <h3 class="method-name"><a href="#method-value">value</a></h3>
373
    <dl>
374
      <dt class="method-signature-label">Signature:</dt>
375
        <dd class="method-signature">.progressbar( "value"
376
377
, <span class="optional">[</span>value<span class="optional">] </span>
378
379
380
381
382
383
)</dd>
384
    </dl>
385
  </div>
386
  <div class="method-description">
387
    <p>This method gets or sets the current value of the progressbar.</p>
388
  </div>
389
</li>
390
391
    </ul>
392
  </div>
393
  <div id="theming">
394
    <h2 class="top-header">Theming</h2>
395
    <p>The jQuery UI Progressbar 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.
396
</p>
397
  <p>If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.progressbar.css stylesheet that can be modified. These classes are highlighed in bold below.
398
</p>
399
400
  <h3>Sample markup with jQuery UI CSS Framework classes</h3>
401
  &lt;div class=&quot;<strong>ui-progressbar </strong>ui-widget ui-widget-content ui-corner-all&quot;&gt;<br />
402
	&nbsp;&nbsp;&nbsp;&lt;div style=&quot;width: 37%;&quot; class=&quot;<strong>ui-progressbar-value</strong> ui-widget-header ui-corner-left&quot;&gt;&lt;/div&gt;<br />
403
	&lt;/div&gt;
404
  <p class="theme-note">
405
    <strong>
406
      Note: This is a sample of markup generated by the progressbar plugin, not markup you should use to create a progressbar. The only markup needed for that is &lt;div&gt;&lt;/div&gt;.
407
    </strong>
408
  </p>
409
410
  </div>
411
</div>
412
413
</p><!--
414
Pre-expand include size: 20165 bytes
415
Post-expand include size: 24550 bytes
416
Template argument size: 10271 bytes
417
Maximum: 2097152 bytes
418
-->
419
420
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3780-1!1!0!!en!2 and timestamp 20101025190218 -->