How to get current slider values ​​from JQuery Slider?

I am using jquery slider, I want all sliders to current values ​​when one slider changes

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've tried this:

        change: function(event, ui) { 

            jQuery(".minbeds").each(function(){
                alert(jQuery(this).val());
            });          
        }

      

but regardless of the slider values, it only warns the value 1

.

enter image description here

UPDATE:

   jQuery(".slider").slider("value"); 

      

will give the current value of the slider when changed, but how can I get all the values ​​of the slider.

+3


source to share


1 answer


Use the following line to access the current values ​​of the slider:



var val = $('#slider').slider("option", "value");

      

+6


source







All Articles