さて、ソースを少し編集してマウスホイールのスクロールを無効にすることで修正しました。
jquery.smoothDivScroll.js の 337 ~ 355 行目 (.min.js ではない) で、すべての行self.stopAutoScrolling();
とself.move(pixels);
行をコメントアウトしました。
if (o.mousewheelScrolling === "vertical" && deltaY !== 0) {
// Stop any ongoing auto scrolling if it's running
// self.stopAutoScrolling();
event.preventDefault();
// pixels = Math.round((o.mousewheelScrollingStep * deltaY) * -1);
// self.move(pixels);
} else if (o.mousewheelScrolling === "horizontal" && deltaX !== 0) {
// Stop any ongoing auto scrolling if it's running
// self.stopAutoScrolling();
event.preventDefault();
// pixels = Math.round((o.mousewheelScrollingStep * deltaX) * -1);
// self.move(pixels);
} else if (o.mousewheelScrolling === "allDirections") {
// Stop any ongoing auto scrolling if it's running
// self.stopAutoScrolling();
event.preventDefault();
// pixels = Math.round((o.mousewheelScrollingStep * delta) * -1);
// self.move(pixels);
}
次に、364行目を次のように変更しました。
el.data("scrollingHotSpotLeft").add(el.data("scrollingHotSpotRight")).add(el.data("scrollWrapper")).mousewheel(function (event) {
.add(el.data("scrollWrapper"))
領域全体でマウスホイールのスクロールも無効にする部分を追加しました。
これを行うとスクロールが少し速くなったので、autoScrollingInterval
設定を調整する必要がありましたが、マウスホイールのスクロールが無効になっているようです。上部のデフォルト設定は、ホットスポット スクロールを無効にするための適切な出発点です (jquery.smoothDivScroll.js の上部にあるオプションでデフォルトで無効にしていますが、ホットスポットは表示されません)。
次に、コードを jquery.smoothDivScroll.min.js ファイルに縮小するだけで、設定が完了します。最終的に、私の構成は次のようになります。
$(document).ready(function() {
$("div#makeMeScrollable").smoothDivScroll({
manualContinuousScrolling: true,
autoScrollingMode: "always",
autoScrollingInterval: 80,
autoScrollingDirection: "endlessLoopRight",
autoScrollingStep: 1,
hotSpotScrolling: false,
mousewheelScrolling: "",
touchScrolling: false
});
});