我想将Jquery滑块范围更改为RTL.我是这样的:http://jqueryui.com/slider/#range
Jquery代码:
$(function() {
$( "#slider-range" ).slider({
range: true,min: 0,max: 1000000,values: [ 100000,500000 ],slide: function( event,ui ) {
$( "#amount" ).val(addCommas(ui.values[1])+ " تومان " + addCommas(ui.values[0])+" تومان");
}
});
$( "#amount" ).val( addCommas( $( "#slider-range" ).slider( "values",1 ) ) + " تومان " + addCommas( $( "#slider-range" ).slider( "values",0 ) ) + "تومان" );
});
function addCommas(nStr){
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx,'$1' + ',' + '$2');
}
return x1 + x2;
}
见图:
最佳答案