Search code examples
javascripttwitter-bootstrapslider

how to use getValue for bootstrap slider?


I am using this http://www.eyecon.ro/bootstrap-slider/ for a slider in a page I am working on,I don't understand the api. Can someone help me with this ?

$(..).slider('getValue')

returns the dom element while I saw this in the code

$(..).slider().getValue() 

which returns a method not found error. I am aware of the .slide event which can be used for this,but how do you access the value directly ?


Solution

  • I'am using it this way

    <input type="text" id="slider1" class="span2 slider" value="80" data-slider-min="50" data-slider-max="90" data-slider-step="0.1" data-slider-value="83"  data-slider-selection="after" data-slider-tooltip="hide">
     $('.slider').on('slide', function (ev) {
            console.log($('#slider1').val());
    
    
        });
    

    So I access value with $('#slider1').val(). I hope this is going to be helpful