我在我的网站上安装了“Slider Range Widget jQuery Uj”,你可以在这里查看文档:
http://jqueryui.com/slider/#range
//basic installation is here
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
});
HTML
<label for="amount">Price range:</label><input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">
如何在更改时使用ajax提交“金额”的值?
答案 0 :(得分:0)
您可以在stop()
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
},
stop: function( event, ui ) {
$.ajax({
//do your ajax call here
});
}
});
希望这有帮助,谢谢