Ticket #3469: jquery.ui.progressbar.js.patch
File jquery.ui.progressbar.js.patch, 1.6 KB (added by , 13 years ago) |
---|
-
ui/jquery.ui.progressbar.js
103 103 _refreshValue: function() { 104 104 var value = this.value(); 105 105 this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right"); 106 this. valueDiv.width(value + '%');106 this.options.animate ? this.valueDiv.animate({'width': value + '%'}, 'slow') : this.valueDiv.width(value + '%'); 107 107 this.element.attr("aria-valuenow", value); 108 108 } 109 109 … … 112 112 $.extend($.ui.progressbar, { 113 113 version: "@VERSION", 114 114 defaults: { 115 value: 0 115 value: 0, 116 animate: false 116 117 } 117 118 }); 118 119 -
tests/visual/progressbar/default.html
14 14 $("#progress").keyup(function() { 15 15 bars.progressbar("value", +this.value); 16 16 }).keyup(); 17 $("#animated").click(function() { 18 bars.progressbar("option", "animate", this.checked); 19 }).triggerHandler("click"); 20 21 $("#simulate").click(function() { 22 for (var i = 1; i <= 128; i*=2) { 23 setTimeout(function() { 24 bars.progressbar("value", bars.progressbar("value") + 5); 25 }, 1000 - i * 10); 26 } 27 }); 17 28 }); 18 29 </script> 19 30 </head> … … 24 35 <div id="progressbar3" style="width:100px"></div> 25 36 26 37 <input id="progress" value="10" /> 38 <input id="animated" type="checkbox" /> 39 <button id="simulate">Simulate progress</button> 27 40 28 41 </body> 29 42 </html>