Skip to content

Commit

Permalink
Fix scrolling for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
wclr committed Oct 20, 2014
1 parent 7073dd3 commit fab51bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fab51bc

Please sign in to comment.