mootools/mootools-more — Issue #1068: IE8: Slider setRange([0,0]) results in division to zero
Author: hummal
Created: 2011-11-12 15:05:34+00:00
State: open

I have to set the range to 0,0 because there is no content. This works in every browser but IE8 (below not tested).

The result is that the function toPosition(step) which is called from set(step), returns a NaN if the Range is 0,0.

Before:

return (this.full * Math.abs(this.min - step)) / (this.steps * this.stepSize) - this.options.offset;

After:

var returnValue = 0;

if( (this.steps * this.stepSize) - this.options.offset !== 0 ) {
returnValue = (this.full * Math.abs(this.min - step)) / (this.steps * this.stepSize) - this.options.offset;
}
return returnValue;