Skip to content
Permalink
Browse files

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 55081dae775c1422552b5b580443e160fb99adf9
Showing with 6 additions and 1 deletion.
  1. +6 −1 ui/ui.slider.js
@@ -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);

0 comments on commit 55081da

Please sign in to comment.
You can’t perform that action at this time.