From 665711a1a10e4ef4ff6e4214c62da1319f045427 Mon Sep 17 00:00:00 2001 From: David Skiff Date: Thu, 17 Oct 2013 16:50:49 -0700 Subject: [PATCH] Fix axis deltas on Firefox < 17 - FF versions less than 17 use DOMMouseScroll event, which provides a detail (the magnitude) and axis of the scroll. However, it doesn't provide individual dy, dx values, and the axis is currently ignored by jquery-mousewheel. --- jquery.mousewheel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jquery.mousewheel.js b/jquery.mousewheel.js index 9d65c7162..2fc12fb05 100755 --- a/jquery.mousewheel.js +++ b/jquery.mousewheel.js @@ -82,6 +82,18 @@ if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } if ( orgEvent.detail ) { delta = orgEvent.detail * -1; } + if ( orgEvent.axis ) { + if ( orgEvent.axis === HORIZONTAL_AXIS ) { + deltaX = delta; + deltaY = 0; + } + + if ( orgEvent.axis === VERTICAL_AXIS ) { + deltaX = 0; + deltaY = delta; + } + } + // New school wheel delta (wheel event) if ( orgEvent.deltaY ) { deltaY = orgEvent.deltaY * -1;