0

我正在尝试按价格范围搜索物业。我已附加与搜索选项相关的我的 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>
4

2 回答 2

1

使用http://egorkhmelev.github.com/jslider/ JQuery 滑块插件,它提供比特数格式和货币..

于 2012-12-17T04:10:28.467 回答
-1

你试过这个吗?

                var min_val = $0;
                var max_val = $1000000;
                var ini_min_val = $100000;
                var ini_max_val = $500000;
                var step = $5000;
于 2012-12-17T04:10:00.890 回答