jQuery简单滑块不';不要对触摸事件做出反应

jQuery简单滑块不';不要对触摸事件做出反应,jquery,jquery-plugins,touch,Jquery,Jquery Plugins,Touch,我使用的是jQuery插件Simple Slider(),但在触摸设备上,无法拖动范围值句柄 我尝试编辑下面simple-slider.js中的代码部分,将“mousedown、mousemove和mouseup”替换为相应的触摸值“touchstart/move/end”-但没有成功 如何在触摸设备上工作 this.track.bind("mousedown touchstart", function (e) { return i.trackEvent(e) }), this.sett

我使用的是jQuery插件Simple Slider(),但在触摸设备上,无法拖动范围值句柄

我尝试编辑下面simple-slider.js中的代码部分,将“mousedown、mousemove和mouseup”替换为相应的触摸值“touchstart/move/end”-但没有成功

如何在触摸设备上工作

this.track.bind("mousedown touchstart", function (e) {
    return i.trackEvent(e)
}), this.settings.highlight && this.highlightTrack.bind("mousedown touchstart", function (e) {
    return i.trackEvent(e)
}), this.dragger.bind("mousedown touchstart", function (e) {
    if (e.which !== 1) return;
    return i.dragging = !0, i.dragger.addClass("dragging"), i.domDrag(e.pageX, e.pageY), !1
}), e("body").bind("mousemove touchmove", function (t) {
    if (i.dragging) return i.domDrag(t.pageX, t.pageY), e("body").css({
        cursor: "pointer"
    })
}).bind("mouseup touchend", function (t) {
    if (i.dragging) return i.dragging = !1, i.dragger.removeClass("dragging"), e("body").css({
        cursor: "auto"
    })
}), this.pagePos = 0, this.input.val() === "" ? (this.value = this.getRange().min, this.input.val(this.value)) : this.value = this.nearestValidValue(this.input.val()), this.setSliderPositionFromValue(this.value), r = this.valueToRatio(this.value), this.input.trigger("slider:ready", {
    value: this.value,
    ratio: r,
    position: r * this.slider.outerWidth(),
    el: this.slider
}

以下是插件信息的链接:

以下简单滑块的更新代码同时支持鼠标和触摸事件: