jQuery范围滑块如何破千



我使用jQuery滑块,需要突破数千。我该怎么做?这是我的密码。

$( function() {
$( ".ui-slider-handle" ).draggable();
$( "#penthousePrice" ).slider({
range: true,
min: 10000000,
max: 1500000000,
values: [ 100000000, 300000000 ],
slide: function( event, ui ) {
$( "#penthouseAmount" ).val(ui.values[ 0 ]);
$( "#penthouseAmount2" ).val(ui.values[ 1 ]);
}
});
$( "#penthouseAmount" ).val($( "#penthousePrice" ).slider( "values", 0 ));
$( "#penthouseAmount2" ).val($( "#penthousePrice" ).slider( "values", 1 ));
});

我解决了这个问题。只需使用.toLocaleString('ru-ru'((;现在我的代码

$( function() {
$( ".ui-slider-handle" ).draggable();
$( "#penthousePrice" ).slider({
range: true,
min: 10000000,
max: 1500000000,
values: [ 100000000, 300000000 ],
slide: function( event, ui ) {
$( "#penthouseAmount" ).val(ui.values[ 0 ].toLocaleString('ru-RU'));
$( "#penthouseAmount2" ).val(ui.values[ 1 ].toLocaleString('ru-RU'));
}
});
$( "#penthouseAmount" ).val($( "#penthousePrice" ).slider( "values", 0 ).toLocaleString('ru-RU')) ;
$( "#penthouseAmount2" ).val($( "#penthousePrice" ).slider( "values", 1 ).toLocaleString('ru-RU')) ;
});

最新更新