jquery.event.swipe
jquery.event.swipe copied to clipboard
Simplify swipe or scroll math formula with Math.abs
Hi,
It took me a bit of time to verify the swipe or scroll math in index.html
before using it in my code. If I understand the formula correctly, you're basically comparing absolute values to see whether finger movement is more pronounced vertically or horizontally. Replacing that code with if(Math.abs(e.distY) > Math.abs(e.distX)){ e.preventDefault();}
would make things easier to intuit.