Created
November 14, 2011 19:27
-
-
Save madmanlear/1364869 to your computer and use it in GitHub Desktop.
jSwipe Edits
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
/* | |
* 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