Skip to content

Instantly share code, notes, and snippets.

@madmanlear
Created November 14, 2011 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madmanlear/1364869 to your computer and use it in GitHub Desktop.
Save madmanlear/1364869 to your computer and use it in GitHub Desktop.
jSwipe Edits
/*
* Edits to the jSwipe jquery plugin to better handle swiping without losing default scroll functionality on mobile devices
* jSwipe - jQuery Plugin
* http://plugins.jquery.com/project/swipe
* http://www.ryanscherf.com/demos/swipe/
* Replace the touchMove function with the following:
*/
function touchMove(event) {
finalCoord.x = event.targetTouches[0].pageX // Updated X,Y coordinates
finalCoord.y = event.targetTouches[0].pageY
var change = originalCoord.x - finalCoord.x;
if(change > 10 || change < -10) {
event.preventDefault();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment