How to get current slider values from JQuery Slider?
22,398
Use the following line to access the current values of the slider:
var val = $('#slider').slider("option", "value");
Comments
-
Kanishka Panamaldeniya over 4 years
I am using jquery slider , i want to all sliders current values when one slider is changing
Slider code:
var slider = jQuery("<div class='slider'></div>").insertAfter(select) .slider({ min : 0, max : 4, range : "min", value : select[0].selectedIndex + 1, slide : function(event, ui) { }, change: function(event, ui) { } });
I tried this:
change: function(event, ui) { jQuery(".minbeds").each(function(){ alert(jQuery(this).val()); }); }
but whatever the slider values, it is only alerting the value
1
.UPDATE:
jQuery(".slider").slider("value");
will give the current slider value when change , but how can i get all slider values .
-
Kanishka Panamaldeniya over 11 yearsthat returns a complex object , and i already tried that one :( . is there an easy way
-
YogeshWaran over 11 years@KanishkaPanamaldeniya: No,it returns integer value not complex object.
-
Kanishka Panamaldeniya over 11 years@YogeshWaran , yes sorry i used a wrong class . now it is working , thanks guys
-
kolexinfos almost 11 yearsI am getting "Null No properties" using this syntax in my chrome debugger, why is datfor jquerymobile @Zenith