reset jquery slider

折月煮酒 提交于 2020-01-04 06:30:28

问题


how can I reset jquery slider so it as set default values as calls all callback methods like slide etc.

$('#value-slider').slider({
    min: 1000,
    max: 20000000,
    values: [ 1, 20000000 ],
    step: 1000,
    range: true,
    slide: function(event,ui){
        $('#search-panel input[name="value1"]').val(ui.values[0]);
        $('#search-panel input[name="value2"]').val(ui.values[1]);
        $('#value-count span').text(ui.values[0] + ' - ' + ui.values[1] );
    }
});

Thnaks


回答1:


Are you looking for the following snippet

$("#value-slider").slider("value", $("#value-slider").slider("option", "min") );




回答2:


There is no built in function reset, had to write own reset



来源:https://stackoverflow.com/questions/9127604/reset-jquery-slider

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!