问题
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