我有一个问题,我在加载页面时无法检索滑块值,它只显示$ [object Object] - $ [object Object]。如何修复代码?
$( function(){
$("#slider-range").slider({
range:true,
min:0.00,
max:499.00,
values:[0.00, 499.00],
slide: function(event, ui){
$("#amount").val("$" + ui.values[0] + "-$" + ui.values[1]);
}
});
$("#amount").val("$" + $("slider-range").slider("values",0) + "-$" + $("slider-range").slider("values", 1));
答案 0 :(得分:0)
检查一下..
$( function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 499,
values: [ 0, 499],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
});