I am using the following code and I am wondering how to get the min and max values from the slider to my lowCount and HighCount variables? Right now it only returns NaN.
function countDown() {
$("#slider-range").slider({
range: true,
min: 0,
max: 60,
values: [5, 15],
slide: function(event, ui) {
$("#amount").val(ui.values[0] + " Minutes - " + ui.values[1] + " Minutes");
}
});
$("#amount").val($("#slider-range").slider("values", 0) + " Minutes - " + $("#slider-range").slider("values", 1) + " Minutes");
var lowCount = 60 * $("#slider-range").slider("values", 0);
var highCount = 60 * $("#slider-range").slider("values", 1);
return Math.floor(Math.random() * highCount) + lowCount;
}
For min value
var min = $("#slider-range").slider("option", "min");
For low value
var low = $("#slider-range").slider("values")[0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With