I need to do a slider range that shows the quantity under each one of the handlers, I followed a working fiddle that uses jquery 1.6.2 and jquery-ui 1.8.5, but in my project I use jquery 2.1.4 and the jquery-ui 1.11.4. It almost works, but there are some issues:
There is a fixed 0 under the begining of the slider bar.
The quantity only appears when I move one of the buttons, and it only appears under the button I am moving. When I move the other button the quantity disapears from the first button and shows in the actual button.
Console shows me a "Uncaught TypeError: Cannot read property 'nodeType' of undefined"
This is my actual range slider with the commented issues: https://jsfiddle.net/zykw73tj/1/
This is the original fiddle: http://jsfiddle.net/william/RSkpH/1/
I obtained the working fiddle from this previous question: jQuery UI Slider: move the value along (with) the handle
If I change the JQuery and the JQuery-UI of the original fiddle for the new ones I see the same issues than in mine.
Thanks
-- HTML --
<div id="slider"></div>
<div id="min"></div>
<div id="max"></div>
-- JQUERY --
$( document ).ready(function() {
$("#slider").slider({
range: true,
min: 0,
max: 1000,
step: 10,
values: [0, 1000],
slide: function(event, ui) {
var delay = function() {
var handleIndex = $(ui.handle).data('index.uiSliderHandle');
var label = handleIndex == 0 ? '#min' : '#max';
$(label).html(ui.value + '€').position({
my: 'center top',
at: 'center bottom',
of: ui.handle,
offset: "0, 10"
});
};
// wait for the ui.handle to set its position
setTimeout(delay, 5);
}
});
$('#min').html($('#slider').slider('values', 0) + '€').position({
my: 'center top',
at: 'center bottom',
of: $('#slider a:eq(0)'),
offset: "0, 10"
});
$('#max').html($('#slider').slider('values', 1) + '€').position({
my: 'center top',
at: 'center bottom',
of: $('#slider a:eq(1)'),
offset: "0, 10"
});
});