Willian El-Turk :
$('.slides').bind('swipeone', function (event, obj) {
var direction=obj.description.split(":")[2]
if (direction=="left"){
} else if (direction=="right"){
}
});
An excellent solution, except that it is executed as soon as the movement from left to right is very sensitive even with a large number of vertical wipes. it would be great to have a minimum travel distance along the x axis. Sort of:
if (direction=="left" && distance>=50px){
Also, I'm not sure how ... Please feel free to edit this!
Edit - you can check the distance (x axis) like this, it works for me:
$('.slides').bind('swipeone', function (event, obj) {
var xMovement = Math.abs(obj.delta[0].lastX);
var direction=obj.description.split(":")[2]
if(xMovement >= 75) {
if (direction=="left"){
} else if (direction=="right"){
}
}
}
source
share