How to get value from jQuery UI slider?

后端 未结 10 2566
粉色の甜心
粉色の甜心 2020-12-01 15:22

I am working on http://gamercity.info/ymusic/. And I am using UI slider as seek bar. While the video is played I want to invoke a seekTo(seconds) function if us

10条回答
  •  离开以前
    2020-12-01 16:02

    $("#slider").slider(
    {
                value:100,
                min: 0,
                max: 500,
                step: 50,
                slide: function( event, ui ) {
                    $( "#slider-value" ).html( ui.value );
                }
    }
    );
    

    JS FIDDLE EXAMPLE : http://jsfiddle.net/hiteshbhilai2010/5TTm4/1162/

    you can have a function like this

    function seekTo(seek_value)
    {
    $("#slider").slider('option', 'value',seek_value);
    
    }
    

提交回复
热议问题