2 * jQuery UI Progressbar 1.7.1
4 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5 * Dual licensed under the MIT (MIT-LICENSE.txt)
6 * and GPL (GPL-LICENSE.txt) licenses.
8 * http://docs.jquery.com/UI/Progressbar
15 $.widget("ui.progressbar", {
20 .addClass("ui-progressbar"
22 + " ui-widget-content"
26 "aria-valuemin": this._valueMin(),
27 "aria-valuemax": this._valueMax(),
28 "aria-valuenow": this._value()
31 this.valueDiv = $('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);
40 .removeClass("ui-progressbar"
42 + " ui-widget-content"
45 .removeAttr("aria-valuemin")
46 .removeAttr("aria-valuemax")
47 .removeAttr("aria-valuenow")
48 .removeData("progressbar")
49 .unbind(".progressbar");
51 this.valueDiv.remove();
53 $.widget.prototype.destroy.apply(this, arguments);
57 value: function(newValue) {
58 arguments.length && this._setData("value", newValue);
62 _setData: function(key, value) {
66 this.options.value = value;
68 this._trigger('change', null, {});
72 $.widget.prototype._setData.apply(this, arguments);
78 var val = this.options.value;
79 if (val < this._valueMin()) val = this._valueMin();
80 if (val > this._valueMax()) val = this._valueMax();
86 _valueMin: function() {
91 _valueMax: function() {
96 _refreshValue: function() {
97 var value = this.value();
98 this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right");
99 this.valueDiv.width(value + '%');
100 this.element.attr("aria-valuenow", value);
105 $.extend($.ui.progressbar, {