I’m using jgestures for handling touch-events on an galaxy SII.
the events I implement don’t react in any way. Here on stackoverflow they suggest not to use swipeleft or simular event, because it has to be exact. but the alternatives don’t work either
<script type="text/javascript">
$(document).on('swipeleftup swipeleftdown', function(){
// code to be executed
});
<script/>
I know this question is a tad old but I came across it while trying to solve the same problem. From what I can tell it appears that the jGesture library doesn’t work on android except for touchone. I’ve tried using their example on both ICS and JB and only their touch one event appears to work.
As such I’ve done some research into the best alternatives. While there are a lot the primary one appears to be JQuery Mobile. It’s more mature now and there is an alpha builder to generate a js with just the touch event management (see download), that way you can just choose the event stuff (note that this is only for the beta version, not for the current stable release). I created a touch only js and the min was 6.2kB. The older version would create a 20kB js. So it’s an improvement!
The events for jQuery Mobile are well documented, as you can see they have a reasonable range, more than enough for the more generic behaviour. Some disadvantages is that swipe is just left and right and there are no pinch events.
Another alternative is the TouchSwipe jQuery plugin. This has extensive demos and a branch that supports pinch events. I’ve tried the demos on ICS and they all work fine. The size of the branch with pinch support is 4.3kB. Note however that there is no demo for pinch, so I’ve yet to determine if that works for ICS. Try the TouchSwipe Demo on your Galaxy SII to see if this would be ok for yourself.