src/jquery.nstSlider.js
function (val, max) {
            var $this = this;
            var rangeMin = $this.data('range_min');
            var rangeMax = $this.data('range_max');

            if (val <= 0)   { return rangeMin; }
            if (val >= max) { return rangeMax; }

            //
            // To do this we first map 0 -- max relatively withing [minRange
            // and maxRange], that is between [0 and (maxRange-minRange)].
            //
            var relativeMapping = (rangeMax - rangeMin) * val / max;

            // ... then we bring this to the actual value by adding rangeMin.
            return relativeMapping + rangeMin;
        }
function (val, max) {
            var $this = this;
            var rangeMin = $this.data('range_min');
            var rangeMax = $this.data('range_max');

            if (val <= 0)   { return rangeMin; }
            if (val >= max) { return rangeMax; }

            //
            // To do this we first map 0 -- max relatively withing [minRange
            // and maxRange], that is between [0 and (maxRange-minRange)].
            //
            var relativeMapping = (rangeMax - rangeMin) * val / max;

            // ... then we bring this to the actual value by adding rangeMin.
            return relativeMapping + rangeMin;
        }
function ( val , max ) { var $this = this ; var rangeMin = $this . data ( 'range_min' ) ; var rangeMax = $this . data ( 'range_max' ) ; if ( val <= 0 ) { return rangeMin ; } if ( val >= max ) { return rangeMax ; } // // To do this we first map 0 -- max relatively withing [minRange // and maxRange], that is between [0 and (maxRange-minRange)]. // var relativeMapping = ( rangeMax - rangeMin ) * val / max ; // ... then we bring this to the actual value by adding rangeMin. return relativeMapping + rangeMin ; }
/*
Maps a value between [0 -- max] back into [minRange -- maxRange].
The target range can be a floating point number.
/ * Maps a value between [ 0 -- max ] back into [ minRange -- maxRange ] . The target range can be a floating point number .