JQuery slider problem reaching minimum and maximum values

I initialize the jQuery slider and then dynamically set the minimum max values ​​determined by the contents of the json request. Steps av even 100, min a max are recounted to one hundred, in most cases somewhere between 300 and 4800.

The slider values ​​and settings are fine, but when I move the handle, I can not get it to the end, it stops a few steps from the minimum / maximum values. Why is this?

I tried all kinds of things, nothing works. I ended up adding 200 in the upper value and subtracting 200 in the lower value and compensated, but this is a hack, not a solution.

+5
source share
3

"" ui.value . . jQuery UI - 0, , , .

+6

, 5 , . , 0 1 0,01. , , 0,02 0,98.

- , : , , , .

('.slider-container').slider({
                min: -0.02, max: 1.02, step: 0.01, slide: function () {

                    // make values below 0 and over 1 snap back
                    if ($(this).slider('value') < 0) {
                        $(this).slider('value', 0);
                    }

                    if ($(this).slider('value') > 1) {
                        $(this).slider('value', 1);
                    }
});
0

min: 35000.74
max: 150000
step: 1 //(default, did not actually change it)

- 149999.74. , , 1 , , .

min 35000 (Math.floor()), .

0

All Articles