I initialize my slider like this:
var min = 0.1;
var max = 20;
var low = 0.1;
var high = 20;
var step = 0.1;
$(this).slider({
range: true,
min: min, // 0.1
max: max, // 20
values: [ low, high ], // 0.1 | 20
step: step, // 0.1
animate: "slow",
slide: function(event, ui) { ... }
Which was working perfeclty, except when my value max/high is 20.
In this case inside the slide function
I get the value 19,9 for ui.values[1]
. As I need to prevent users from moving the second handle I was checking like this:
if (ui.values[1] != high){
return false;
}
Now that 20 is not equal to 19,9 users aren't able to move any of the handles. Any ideas?