Skip to content

Instantly share code, notes, and snippets.

@lqez
Created September 11, 2012 13:54
Show Gist options
  • Save lqez/3698667 to your computer and use it in GitHub Desktop.
Save lqez/3698667 to your computer and use it in GitHub Desktop.
Modification on iScroll
/* 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