From 93783de9aac156cbaf9ca0a602e0f5daab4ccb20 Mon Sep 17 00:00:00 2001 From: alvaro0555 Date: Fri, 25 Oct 2013 21:36:27 +0200 Subject: [PATCH] trackpad horizontal and vertical scroll --- build/iscroll.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/iscroll.js b/build/iscroll.js index d23dd2ea..0d46b9e8 100644 --- a/build/iscroll.js +++ b/build/iscroll.js @@ -242,6 +242,7 @@ function IScroll (el, options) { resizeIndicator: true, mouseWheelSpeed: 20, + mouseWheelScrollsHorizontally: true, snapThreshold: 0.334, @@ -977,9 +978,13 @@ IScroll.prototype = { wheelDeltaX *= this.options.mouseWheelSpeed; wheelDeltaY *= this.options.mouseWheelSpeed; - if ( !this.hasVerticalScroll ) { + if ( !this.hasHorizontalScroll ) { + wheelDeltaX = 0; + } else if ( !this.hasVerticalScroll && this.options.mouseWheelScrollsHorizontally ) { wheelDeltaX = wheelDeltaY; wheelDeltaY = 0; + } if ( !this.hasVerticalScroll ) { + wheelDeltaY = 0; } if ( this.options.snap ) {