Introduction

What's this

This plugin allows to do better swipe/""drag"" actions, you can set the specific directions to the items and who is their container, compatible with all browsers and devices.

How to use

Options

  • container: The container of element (by default: parent)
  • directions: Direction for the swipe separated by commas left,up,down,right (by default: 'left').
  • delay: delay time after ends event in 'ms' (by default: 100).
  • returntime: time necessary for return to initially position in 'ms' (by default: 200).

Default use


(function(){
	$("#left").customSwipe();
	$("#right").customSwipe({
		directions : {
			right : true
		}
	});
	$("#top").customSwipe({
		directions : {
			up : true
		}
	});
	$("#bottom").customSwipe({
		directions : {
			down : true
		}
	});

	$("#omni1").customSwipe({
		directions : {
			left : true,
			up : true
		}
	});
	$("#omni2").customSwipe({
		directions : {
			left : true,
			right : true
		}
	});
	$("#omni3").customSwipe({
		directions : {
			left : true,
			down : true,
			right : true,
			up : true
		}
	});
	$("#gradient-left").customSwipe({
		directions : {
			gradient : true
		}
	});
})();
								

With callback


(function(){
	$("#special:not(.off)").customSwipe({
		directions : {
			left : function(){
				alert ("Direction callback");
				$(this).addClass("off");
			}
		}
	},
	function(){
		alert ("General callback");
	});
})();
								
Examples

Move to left


Hi this text it's in background

Move to right

Move up

Move down


Move to left (with callback)


Move to left, up


Move to left, right


Move to left, right, up, down


Transparent Gradient