Bootstrap Slider change value handler

后端 未结 4 1478
盖世英雄少女心
盖世英雄少女心 2021-01-04 01:04

I\'m using Bootstrap Slider, and I was wondering if there is any way to include a handler for a value change. I see that the documentation includes handlers for slideStart,

4条回答
  •  忘掉有多难
    2021-01-04 01:19

    Instead of change event just use the slide. The promoter is not working well, so in Slide you can set value again.

            var thresholdSlider = $('#Threshold');
            thresholdSlider.slider({
                formater: function (value) {
                    return 'Current value: ' + value;
                }
            });
    
            thresholdSlider.slider().on('slide', function (ev) {
                thresholdSlider.slider('setValue', ev.value);
            });
    

提交回复
热议问题