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

"mouseWheelAnimationDuration" option #983

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ Set the speed of the mouse wheel.

Default: `20`

### <small>options.</small>mouseWheelAnimationDuration

Set the duration of the mouse wheel scroll animation.

Default: `0`

### <small>options.</small>preventDefaultException

These are all the exceptions when `preventDefault()` would be fired anyway despite the **preventDefault** option value.
Expand Down
2 changes: 1 addition & 1 deletion build/iscroll-infinite.js
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ IScroll.prototype = {
newY = this.maxScrollY;
}

this.scrollTo(newX, newY, 0);
this.scrollTo(newX, newY, (this.options.mouseWheelAnimationDuration || 0));

if ( this.options.probeType > 1 ) {
this._execEvent('scroll');
Expand Down
2 changes: 1 addition & 1 deletion build/iscroll-probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ IScroll.prototype = {
newY = this.maxScrollY;
}

this.scrollTo(newX, newY, 0);
this.scrollTo(newX, newY, (this.options.mouseWheelAnimationDuration || 0));

if ( this.options.probeType > 1 ) {
this._execEvent('scroll');
Expand Down
2 changes: 1 addition & 1 deletion build/iscroll-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ IScroll.prototype = {
newY = this.maxScrollY;
}

this.scrollTo(newX, newY, 0);
this.scrollTo(newX, newY, (this.options.mouseWheelAnimationDuration || 0));

// INSERT POINT: _wheel
},
Expand Down
2 changes: 1 addition & 1 deletion build/iscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ IScroll.prototype = {
newY = this.maxScrollY;
}

this.scrollTo(newX, newY, 0);
this.scrollTo(newX, newY, (this.options.mouseWheelAnimationDuration || 0));

// INSERT POINT: _wheel
},
Expand Down
2 changes: 1 addition & 1 deletion src/wheel/build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"insert": {
"OPTIONS": "\t\tmouseWheelSpeed: 20,",
"OPTIONS": "\t\tmouseWheelSpeed: 20,\n\tmouseWheelAnimationDuration: 0,",
"NORMALIZATION": "\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;",
"_init": "\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}"
}
Expand Down
2 changes: 1 addition & 1 deletion src/wheel/wheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
newY = this.maxScrollY;
}

this.scrollTo(newX, newY, 0);
this.scrollTo(newX, newY, (this.options.mouseWheelAnimationDuration || 0));

// INSERT POINT: _wheel
},