How to get the value of the slider bootstrap?

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

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



        
6条回答
  •  独厮守ぢ
    2020-12-03 07:41

    fast fix:

    $.fn.slider = function (option, val) {
    
        if (typeof option == 'string') {
            if (this.length) {
                var data = this.eq(0).data('slider');
                if (data)
                    return data[option](val);
    
                return null;
            }
        }
    
        return this.each(function () {
            var $this = $(this),
                data = $this.data('slider'),
                options = typeof option === 'object' && option;
            if (!data) {
                $this.data('slider', (data = new Slider(this, $.extend({}, $.fn.slider.defaults, options))));
            }
        })
    };
    

提交回复
热议问题