From aa0b57c51d56c057a6b1690906ab2e2ee5112d14 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Sun, 26 Jan 2014 01:33:52 +0900 Subject: [PATCH] Change delta calculation in mousewheel handler. The new version of jquery-mousewheel's delta values are changed, and should use the new calculation for the values. --- src/perfect-scrollbar.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 1b284cb..94f5993 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -272,7 +272,10 @@ // bind handlers var bindMouseWheelHandler = function () { var shouldPrevent = false; - $this.bind('mousewheel' + eventClassName, function (e, delta, deltaX, deltaY) { + $this.bind('mousewheel' + eventClassName, function (e, deprecatedDelta, deprecatedDeltaX, deprecatedDeltaY) { + var deltaX = e.deltaX ? e.deltaX / 10 : deprecatedDeltaX, + deltaY = e.deltaY ? e.deltaY / 10 : deprecatedDeltaY; + if (!settings.useBothWheelAxes) { // deltaX will only be used for horizontal scrolling and deltaY will // only be used for vertical scrolling - this is the default