Reputation: 17566
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 .
Upvotes: 3
Views: 22737
Reputation: 68566
Use the following line to access the current values of the slider:
var val = $('#slider').slider("option", "value");
Upvotes: 6