Skip to content

Commit

Permalink
fix scrolling in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
cubiq committed Sep 19, 2014
1 parent b73f560 commit 114cc30
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
13 changes: 9 additions & 4 deletions build/iscroll-infinite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.1.2 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -337,7 +337,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.1.2',
version: '5.1.3',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -941,8 +941,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
4 changes: 2 additions & 2 deletions build/iscroll-lite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.1.2 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -320,7 +320,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.1.2',
version: '5.1.3',

_init: function () {
this._initEvents();
Expand Down
13 changes: 9 additions & 4 deletions build/iscroll-probe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.1.2 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -335,7 +335,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.1.2',
version: '5.1.3',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1063,8 +1063,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
13 changes: 9 additions & 4 deletions build/iscroll-zoom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.1.2 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -337,7 +337,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.1.2',
version: '5.1.3',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1227,8 +1227,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
13 changes: 9 additions & 4 deletions build/iscroll.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! iScroll v5.1.2 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */
(function (window, document, Math) {
var rAF = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
Expand Down Expand Up @@ -332,7 +332,7 @@ function IScroll (el, options) {
}

IScroll.prototype = {
version: '5.1.2',
version: '5.1.3',

_init: function () {
this._initEvents();
Expand Down Expand Up @@ -1054,8 +1054,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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iscroll",
"description": "Smooth scrolling for the web",
"version": "5.1.2",
"version": "5.1.3",
"homepage": "http://cubiq.org/iscroll-4",
"author": "Matteo Spinelli <[email protected]> (http://cubiq.org)",
"keywords": [
Expand Down

0 comments on commit 114cc30

Please sign in to comment.