我正忙于构建一个 javascript 类来自动创建 Jquery UI 滑块。
CustomSlider.prototype.initialize = function(slider_id, min_id, max_id, step, min, max){
this.$slider = $('#' + slider_id);
this.$min = $('#' + min_id);
this.$max = $('#' + max_id);
this.min = min;
this.max = max;
this.step = step;
this.$slider.slider({
range: true,
step: this.step,
min: this.min,
max: this.max,
values: [(this.min + (step * 4)), (this.max - (step * 4))],
slide: this.slide(event, ui)
});
this.$min.text(this.min + (step * 4));
this.$max.text(this.max - (step * 4));
};
CustomSlider.prototype.slide = function(event, ui){
this.$min.text(ui.values[0]);
this.$max.text(ui.values[1]);
};
当我尝试绑定幻灯片事件时,它不会使用“event”和“ui”变量。如何将此事件绑定到我自己的函数?