How to get min and max values ​​from jQueryUI Slider

I am using the following code and I'm wondering how to get the min and max values ​​from the slider to my lowCount and HighCount variables? Now it 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; } 
+6
source share
1 answer

For the minimum value

 var min = $("#slider-range").slider("option", "min"); 

For low value

 var low = $("#slider-range").slider("values")[0]; 
+17
source

Source: https://habr.com/ru/post/909160/


All Articles