我正在尝试按价格范围搜索物业。我已附加与搜索选项相关的我的 php 和 Jquery。目前金额显示没有逗号和货币符号,如 10000000-100000000。但我想将其更改为 1,000,000-100,000,000 卢比。我怎样才能做到这一点。如果您需要点击这里查看网站。
<script type="text/javascript">
jQuery(document).ready(function(){
/*-----------------------------------------------------------------------------------*/
/* Search Slider in Footer -- Settings can be changed from theme options
/*-----------------------------------------------------------------------------------*/
<?php
if( function_exists( 'ot_get_option' ))
{
?>
var min_val = parseInt(<?php echo ot_get_option( 'min_val', 0 ); ?>);
var max_val = parseInt(<?php echo ot_get_option( 'max_val', 1000000 ); ?>);
var ini_min_val = parseInt(<?php echo ot_get_option( 'ini_min_val', 100000 ); ?>);
var ini_max_val = parseInt(<?php echo ot_get_option( 'ini_max_val', 500000 ); ?>);
var step = parseInt(<?php echo ot_get_option( 'step', 5000 ); ?>);
<?php
}
else
{
?>
var min_val = 0;
var max_val = 1000000;
var ini_min_val = 100000;
var ini_max_val = 500000;
var step = 5000;
<?php
}
?>
$("#slider-range").slider({
range: true,
min: min_val,
max: max_val,
values: [ ini_min_val, ini_max_val ],
step: step,
slide: function( event, ui ) {
$( "#min-price" ).val( ui.values[ 0 ]);
$( "#max-price" ).val( ui.values[ 1 ]);
$( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
}
});
$( "#amount" ).val( $( "#slider-range" ).slider( "values", 0 ) + " - " + $( "#slider-range" ).slider( "values",1 ) );
$( "#min-price" ).val( $( "#slider-range" ).slider( "values", 0 ) );
$( "#max-price" ).val( $( "#slider-range" ).slider( "values", 1 ) );
});
</script>