Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Slider: Fixed divide by zero error when min and max are the same. Fix…
…ed #4155 - IE6 error by min==max.
  • Loading branch information
scottgonzalez committed Feb 17, 2009
1 parent 6754eaa commit 55081da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ui/ui.slider.js
Expand Up @@ -466,7 +466,12 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
lastValPercent = valPercent;
});
} else {
var valPercent = (this.value() - this._valueMin()) / (this._valueMax() - this._valueMin()) * 100;
var value = this.value(),
valueMin = this._valueMin(),
valueMax = this._valueMax(),
valPercent = valueMax != valueMin
? (value - valueMin) / (valueMax - valueMin) * 100
: 0;
var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
this.handle.stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);

Expand Down

0 comments on commit 55081da

Please sign in to comment.