diff options
Diffstat (limited to 'ui/jquery.ui.slider.js')
-rw-r--r-- | ui/jquery.ui.slider.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index 895b536c2..210ca769a 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -591,12 +591,12 @@ $.widget( "ui.slider", $.ui.mouse, { if ( val > this._valueMax() ) { return this._valueMax(); } - var step = this.options.step, + var step = ( this.options.step > 0 ) ? this.options.step : 1, valModStep = val % step, alignValue = val - valModStep; - if ( valModStep >= ( step / 2 ) ) { - alignValue += step; + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); } // Since JavaScript has problems with large floats, round |