I try to connect several range slider from: http://ionden.com/a/plugins/ion.rangeSlider/en.html so that the end of the first slider is automatically recognized as the fix start of the second and so on. Furthermore this should be updated on the fly. My current code works only partially - connection works (even it is not fixed), but the real time update is not working.
Attached the code:
from = 0,
to = 0;
from2 = 0,
to2 = 0;
var saveResult = function (data) {
from = data.from;
to = data.to;
};
var writeResult = function () {
var result = from;
$result.html(result);
};
var saveResult2 = function (data) {
from2 = data.from;
to2 = data.to;
};
var writeResult2 = function () {
var result2 = from2;
$result.html(result);
};
$("#select-length").ionRangeSlider({
hide_min_max: true,
keyboard: true,
min: 0,
max: 20,
from: 0,
to: 10,
type: 'double',
step: 0.25,
prefix: "",
grid: true,
onStart: function (data) {
saveResult(data);
writeResult();
},
onChange: function(data){
saveResult(data);
writeResult();
},
onChange: saveResult,
onFinish: saveResult
});
$("#select-length2").ionRangeSlider({
hide_min_max: true,
keyboard: true,
min: 0,
max: 20.16,
from: to,
to: 12,
type: 'double',
step: 0.25,
prefix: "",
grid: true,
onStart: function (data) {
saveResult2(data);
writeResult2();
},
onChange: function(data){
saveResult2(data);
writeResult2();
},
onChange: saveResult2,
onFinish: saveResult2
});
$("#select-length3").ionRangeSlider({
hide_min_max: true,
keyboard: true,
min: from2,
max: 20.16,
from: 12,
to: 12,
type: 'double',
step: 0.25,
prefix: "",
grid: true
});
Ion.RangeSlider realtime update is doing this way: http://jsfiddle.net/IonDen/4k3d4y3s/