How to get the value of the slider bootstrap?

前端 未结 6 604
刺人心
刺人心 2020-12-03 07:20

How to get the values of the slider bootstrap to hidden iputs?



        
6条回答
  •  生来不讨喜
    2020-12-03 07:43

    At time of writing it's a bit flaky but you can make it work:

    1/ Make sure you specify an empty range starting "value[0]". Unless you do this its internal value field becomes undefined e.g.

    $('#setBidDialogSlider').slider({ value: [0], max: max, step: 0.2, formater: function(v) { return v.toFixed(2)+"BTC" } });
    

    2/ Now finally you can catch the value in the event

    $('#setBidDialogSlider').slider().on('slide', function(ev) {
        $scope.dialog.order_value = ev.value*$scope.dialog.price;
    });
    

提交回复
热议问题