【问题标题】:jQuery range slider how to break thousands?jQuery范围滑块如何打破数千?
【发布时间】:2020-12-31 03:12:05
【问题描述】:

我使用 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 ));
});

【问题讨论】:

    标签: jquery rangeslider


    【解决方案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')) ;
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-06
      • 2015-08-26
      • 2012-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-19
      相关资源
      最近更新 更多