From fab51bc7d1fcaa7c4382d7e1ddafcc8a10773d04 Mon Sep 17 00:00:00 2001 From: Alex Osh Date: Mon, 20 Oct 2014 09:59:55 +0600 Subject: [PATCH] Fix scrolling for firefox https://github.com/cubiq/iscroll/issues/577 --- build/iscroll.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build/iscroll.js b/build/iscroll.js index 0b141f92..edec99fd 100644 --- a/build/iscroll.js +++ b/build/iscroll.js @@ -4,7 +4,7 @@ var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || - window.msRequestAnimationFrame || + window.msRequestAnimat_ionFrame || function (callback) { window.setTimeout(callback, 1000 / 60); }; var utils = (function () { @@ -1048,8 +1048,13 @@ IScroll.prototype = { }, 400); if ( 'deltaX' in e ) { - wheelDeltaX = -e.deltaX; - wheelDeltaY = -e.deltaY; + if (e.deltaMode === 1) { + wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed; + wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed; + } else { + wheelDeltaX = -e.deltaX; + wheelDeltaY = -e.deltaY; + } } else if ( 'wheelDeltaX' in e ) { wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed; wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;