jQuery Mobile Touch Swipe Plugin v1.0

jQuery Mobile's swipe functionality is awesome. Unfortunately you have to load in jQuery Mobile's entire script to use it. This plugin extracts the exact swipe logic from jQuery Mobile and turns it into a simple to use plugin. So if catching left and right swipe events is all you need, this plugin is for you.

ADD AN EVENT BELOW AND SWIPE ME
Events Fired: 0

No Events Added Yet


Download: jQuery Mobile Touch Swipe Plugin - by CodingJack

last updated 04/18/2012


Usage

// listen to both left and right signals
// the String "left" or "right" will be
// passed as an argument to the callback
$(element).touchSwipe(callback); 

// listen for only the left swipe event
$(element).touchSwipeLeft(callback); 

// listen for only the right swipe event
$(element).touchSwipeRight(callback); 

// optional second argument will invoke
// event.stopImmediatePropagation();
// available for all three methods above
$(element).touchSwipe(callback, true);

// unbind both left and right swipe events
$(element).unbindSwipe(); 

// unbind only left swipe event
$(element).unbindSwipeLeft(); 

// unbind only right swipe event
$(element).unbindSwipeRight();

// example callback 
function callback(direction) {
	console.log(direction);
}

Tests

works great works ok works terrible

Special Notes