i\'m trying to implement a touch listener for tablets to trigger some actions depending whether it touchmoved upwards or downwards.
I tried the native listener:
You need to save the last position of the touch, then compare it to the current one.
Rough example:
var lastY;
$(document).bind('touchmove', function (e){
var currentY = e.originalEvent.touches[0].clientY;
if(currentY > lastY){
// moved down
}else if(currentY < lastY){
// moved up
}
lastY = currentY;
});