I am using jSlider to implement a touch-friendly range slider, but I have two problems:
$
rather than $0
(actually I'd prefer it to be $1
but I can't implement that either). I've set up a JSFiddle with my slider: http://jsfiddle.net/v3gUg/9/
Here is the code too, for reference:
var options = {
from: 0,
to: 500,
round: 10,
heterogeneity: ['50/100', '75/250'],
scale: ["£0", '|', "£50", '|' , "£100", '|', "£250", '|', "£500"],
limits: true,
step: 10,
format: { format: '£#' }, // Doesn't return 0 correctly.
skin: "round_plastic",
onstatechange: function() {
// Check range here and return false if too small?
// But return false doesn't seem to do anything.
return false;
}
};
jQuery("#price-slider").slider(options);
Can anyone suggest a solution to either problem?
EDIT:
$(document).ready(function() {
var options = {
from: 0,
to: 500,
round: 10,
heterogeneity: ['50/100', '75/250'],
scale: ["$0", '|', "$50", '|' , "$100", '|', "$250", '|', "$500"],
limits: true,
step: 10,
format: { format: '$#,' },
skin: "round_plastic",
callback: function() {
// if (range too small)
//return false;
},
onstatechange: function( value ){
var array = value.split(";");
if(array[0] == array[1])
{
value = array[0]+";"+array[1];
$(".holder").slider("value", p1, p2)
}
}
};
jQuery("#price-slider").slider(options);
});