I am working on some jQuery UI sliders and I was wondering is there a way to display a range of values instead of just single values. Such as 10-20, 20-30, 30-40 instead of just 10,20,30,40? I would really appreciate any help on this. I know there is a range slider in the API, but I am trying to get it to snap to the range increments.
Here is a jsfiddle for a working example
$(function() {
//age range function
$("#ageRangeSlider").slider({
value: 10,
min: 0,
max: 100,
step: 10,
slide: function(event, ui) {
$("#yourAgeRange").val(ui.value);
}
});
$("#yourAgeRange").val($("#ageRangeSlider").slider("value"));
});
<p>
<label for="yourAgeRange">Your age range:</label>
<input type="text" id="yourAgeRange" style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="ageRangeSlider"></div>