Created
September 11, 2012 13:54
-
-
Save lqez/3698667 to your computer and use it in GitHub Desktop.
Modification on iScroll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Add preventThreshold in default options and disable preventDefault, about 65L */ | |
that.options = { | |
/* ... */ | |
preventThreshold: 3, | |
/* ... */ | |
onBeforeScrollStart: function (e) { /*e.preventDefault();*/ }, | |
/* ... */ | |
}; | |
/* 2.Add threshold check code in _move function, about 380L */ | |
if ( (that.options.hScroll && Math.abs(deltaX) >= that.options.preventThreshold ) | |
|| (that.options.vScroll && Math.abs(deltaY) >= that.options.preventThreshold ) ) | |
e.preventDefault(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment