Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

trackpad horizontal and vertical scroll #523

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ function IScroll (el, options) {
resizeIndicator: true,

mouseWheelSpeed: 20,
mouseWheelScrollsHorizontally: true,

snapThreshold: 0.334,

Expand Down Expand Up @@ -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 ) {
Expand Down