Skip to content

Commit 599dcf3

Browse files
committed
Fix how delta is set when deltaY and deltaX has a value
1 parent f928bbe commit 599dcf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery.mousewheel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282

8383
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
8484
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
85+
deltaX = deltaY * -1;
8586
deltaY = 0;
86-
deltaX = delta * -1;
8787
}
8888

8989
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
@@ -96,7 +96,7 @@
9696
}
9797
if ( 'deltaX' in orgEvent ) {
9898
deltaX = orgEvent.deltaX;
99-
delta = detlaX * -1;
99+
if ( deltaY === 0 ) { delta = deltaX * -1; }
100100
}
101101

102102
// No change actually happened, no reason to go any further

0 commit comments

Comments
 (0)