Changeset 11425
- Timestamp:
- 11/06/07 17:24:39 (13 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
form/Slider.js (modified) (3 diffs)
-
tests/form/test_Slider.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/Slider.js
r11098 r11425 6 6 dojo.require("dijit.form.Button"); 7 7 dojo.require("dojo.number"); 8 dojo.require("dojo._base.fx"); 8 9 9 10 dojo.declare( … … 40 41 // If clicking the progress bar changes the value or not 41 42 clickSelect: true, 43 44 // slideDuration: Number 45 // The time in ms to take to animate the slider handle from 0% to 100% 46 slideDuration: 1000, 42 47 43 48 widgetsInTemplate: true, … … 120 125 this.inherited('setValue', arguments); 121 126 var percent = (value - this.minimum) / (this.maximum - this.minimum); 122 this.progressBar.style[this._progressPixelSize] = (percent*100) + "%"; 123 this.remainingBar.style[this._progressPixelSize] = ((1-percent)*100) + "%"; 127 if(priorityChange && this.slideDuration > 0 && this.progressBar.style[this._progressPixelSize]){ 128 // animate the slider 129 var _this = this; 130 var props = {}; 131 var start = parseFloat(this.progressBar.style[this._progressPixelSize]); 132 var duration = this.slideDuration * (percent-start/100); 133 if(duration < 0){ duration = 0 - duration; } 134 props[this._progressPixelSize] = { start: start, end: percent*100, units:"%" }; 135 dojo.animateProperty({ node: this.progressBar, duration: duration, 136 onAnimate: function(v){_this.remainingBar.style[_this._progressPixelSize] = (100-parseFloat(v[_this._progressPixelSize])) + "%";}, 137 properties: props 138 }).play(); 139 } 140 else{ 141 this.progressBar.style[this._progressPixelSize] = (percent*100) + "%"; 142 this.remainingBar.style[this._progressPixelSize] = ((1-percent)*100) + "%"; 143 } 124 144 }, 125 145 -
dijit/trunk/tests/form/test_Slider.html
r10960 r11425 79 79 </div> 80 80 Slider2 Value:<input readonly id="slider2input" size="3" value="10"> 81 <h1>Fancy HTML labels :</h1>81 <h1>Fancy HTML labels (no slide animation):</h1> 82 82 <div dojoType="dijit.form.HorizontalSlider" name="horizontal2" 83 83 minimum="1" … … 87 87 showButtons="false" 88 88 intermediateChanges="true" 89 slideDuration="0" 89 90 style="width:300px; height: 40px;" 90 91 id="slider3">