Response title
This is preview!
$this.bind( touchMoveEvent, moveHandler )
.one( touchStopEvent, function( event ) {
$this.unbind( touchMoveEvent, moveHandler );
var x = Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ),
y = Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ),
callback = '';
if ( start && stop ) {
if ( stop.time - start.time < $.event.special.swipe.durationThreshold ) {
if( x > 30 && y < 75 ) {
callback = start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight";
} else if( x < 75 && y > 30 ) {
callback = start.coords[1] > stop.coords[1] ? "swipeup" : "swipedown";
}
}
};
if(callback) start.origin.trigger( "swipe" ).trigger( callback );
![]() | var x = Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ), |
© 2013 jQuery Foundation
Sponsored by and others.