答案 0 :(得分:1)
我重写了_drag函数,它对我有用。但在我的情况下,我没有使用轨道拇指,只有滚动事件。
function _drag(event) {
if (self.hasContentToSroll) {
var mousePositionNew = isHorizontal ? event.pageX : event.pageY,
thumbPositionDelta = hasTouchEvents ? (mousePosition - mousePositionNew) : (mousePositionNew - mousePosition),
thumbPositionNew = Math.min((self.trackSize - self.thumbSize), Math.max(0, self.thumbPosition + thumbPositionDelta));
if (thumbPositionDelta < 0) {
self.contentPosition -= self.options.wheelSpeed;
} else {
self.contentPosition += self.options.wheelSpeed;
}
self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));
self.thumbPosition = self.contentPosition / self.trackRatio;
$container.trigger("move");
$thumb.css(posiLabel, thumbPositionNew);
$overview.css(posiLabel, -self.contentPosition);
}
}