plugins/touchswipe.js
function touchStart(jqEvent) {
			//If we already in a touch event (a finger already in use) then ignore subsequent ones..
			if( getTouchInProgress() )
				return;
			
			//Check if this element matches any in the excluded elements selectors,  or its parent is excluded, if so, DON'T swipe
			if( $(jqEvent.target).closest( options.excludedElements, $element ).length>0 ) 
				return;
				
			//As we use Jquery bind for events, we need to target the original event object
			//If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
			var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;
			
			var ret,
				touches = event.touches,
				evt = touches ? touches[0] : event;

			phase = PHASE_START;

			//If we support touches, get the finger count
			if (touches) {
				// get the total number of fingers touching the screen
				fingerCount = touches.length;
			}
			//Else this is the desktop, so stop the browser from dragging content
			else {
				jqEvent.preventDefault(); //call this on jq event so we are cross browser
			}

			//clear vars..
			distance = 0;
			direction = null;
			pinchDirection=null;
			duration = 0;
			startTouchesDistance=0;
			endTouchesDistance=0;
			pinchZoom = 1;
			pinchDistance = 0;
			fingerData=createAllFingerData();
			maximumsMap=createMaximumsData();
			cancelMultiFingerRelease();

			
			// check the number of fingers is what we are looking for, or we are capturing pinches
			if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) {
				// get the coordinates of the touch
				createFingerData( 0, evt );
				startTime = getTimeStamp();
				
				if(fingerCount==2) {
					//Keep track of the initial pinch distance, so we can calculate the diff later
					//Store second finger data as start
					createFingerData( 1, touches[1] );
					startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start);
				}
				
				if (options.swipeStatus || options.pinchStatus) {
					ret = triggerHandler(event, phase);
				}
			}
			else {
				//A touch with more or less than the fingers we are looking for, so cancel
				ret = false; 
			}

			//If we have a return value from the users handler, then return and cancel
			if (ret === false) {
				phase = PHASE_CANCEL;
				triggerHandler(event, phase);
				return ret;
			}
			else {
				if (options.hold) {
					holdTimeout = setTimeout($.proxy(function() {
						//Trigger the event
						$element.trigger('hold', [event.target]);
						//Fire the callback
						if(options.hold) {
							ret = options.hold.call($element, event, event.target);
						}
					}, this), options.longTapThreshold );
				}

				setTouchInProgress(true);
			}

            return null;
		}
function touchStart(jqEvent) {
			//If we already in a touch event (a finger already in use) then ignore subsequent ones..
			if( getTouchInProgress() )
				return;
			
			//Check if this element matches any in the excluded elements selectors,  or its parent is excluded, if so, DON'T swipe
			if( $(jqEvent.target).closest( options.excludedElements, $element ).length>0 ) 
				return;
				
			//As we use Jquery bind for events, we need to target the original event object
			//If these events are being programmatically triggered, we don't have an original event object, so use the Jq one.
			var event = jqEvent.originalEvent ? jqEvent.originalEvent : jqEvent;
			
			var ret,
				touches = event.touches,
				evt = touches ? touches[0] : event;

			phase = PHASE_START;

			//If we support touches, get the finger count
			if (touches) {
				// get the total number of fingers touching the screen
				fingerCount = touches.length;
			}
			//Else this is the desktop, so stop the browser from dragging content
			else {
				jqEvent.preventDefault(); //call this on jq event so we are cross browser
			}

			//clear vars..
			distance = 0;
			direction = null;
			pinchDirection=null;
			duration = 0;
			startTouchesDistance=0;
			endTouchesDistance=0;
			pinchZoom = 1;
			pinchDistance = 0;
			fingerData=createAllFingerData();
			maximumsMap=createMaximumsData();
			cancelMultiFingerRelease();

			
			// check the number of fingers is what we are looking for, or we are capturing pinches
			if (!touches || (fingerCount === options.fingers || options.fingers === ALL_FINGERS) || hasPinches()) {
				// get the coordinates of the touch
				createFingerData( 0, evt );
				startTime = getTimeStamp();
				
				if(fingerCount==2) {
					//Keep track of the initial pinch distance, so we can calculate the diff later
					//Store second finger data as start
					createFingerData( 1, touches[1] );
					startTouchesDistance = endTouchesDistance = calculateTouchesDistance(fingerData[0].start, fingerData[1].start);
				}
				
				if (options.swipeStatus || options.pinchStatus) {
					ret = triggerHandler(event, phase);
				}
			}
			else {
				//A touch with more or less than the fingers we are looking for, so cancel
				ret = false; 
			}

			//If we have a return value from the users handler, then return and cancel
			if (ret === false) {
				phase = PHASE_CANCEL;
				triggerHandler(event, phase);
				return ret;
			}
			else {
				if (options.hold) {
					holdTimeout = setTimeout($.proxy(function() {
						//Trigger the event
						$element.trigger('hold', [event.target]);
						//Fire the callback
						if(options.hold) {
							ret = options.hold.call($element, event, event.target);
						}
					}, this), options.longTapThreshold );
				}

				setTouchInProgress(true);
			}

            return null;
		}
function touchStart ( jqEvent ) { //If we already in a touch event (a finger already in use) then ignore subsequent ones.. if ( getTouchInProgress ( ) ) return ; //Check if this element matches any in the excluded elements selectors,  or its parent is excluded, if so, DON'T swipe if ( $ ( jqEvent . target ) . closest ( options . excludedElements , $element ) . length > 0 ) return ; //As we use Jquery bind for events, we need to target the original event object //If these events are being programmatically triggered, we don't have an original event object, so use the Jq one. var event = jqEvent . originalEvent ? jqEvent . originalEvent : jqEvent ; var ret , touches = event . touches , evt = touches ? touches [ 0 ] : event ; phase = PHASE_START ; //If we support touches, get the finger count if ( touches ) { // get the total number of fingers touching the screen fingerCount = touches . length ; } //Else this is the desktop, so stop the browser from dragging content else { jqEvent . preventDefault ( ) ; //call this on jq event so we are cross browser } //clear vars.. distance = 0 ; direction = null ; pinchDirection = null ; duration = 0 ; startTouchesDistance = 0 ; endTouchesDistance = 0 ; pinchZoom = 1 ; pinchDistance = 0 ; fingerData = createAllFingerData ( ) ; maximumsMap = createMaximumsData ( ) ; cancelMultiFingerRelease ( ) ; // check the number of fingers is what we are looking for, or we are capturing pinches if ( ! touches || ( fingerCount === options . fingers || options . fingers === ALL_FINGERS ) || hasPinches ( ) ) { // get the coordinates of the touch createFingerData ( 0 , evt ) ; startTime = getTimeStamp ( ) ; if ( fingerCount == 2 ) { //Keep track of the initial pinch distance, so we can calculate the diff later //Store second finger data as start createFingerData ( 1 , touches [ 1 ] ) ; startTouchesDistance = endTouchesDistance = calculateTouchesDistance ( fingerData [ 0 ] . start , fingerData [ 1 ] . start ) ; } if ( options . swipeStatus || options . pinchStatus ) { ret = triggerHandler ( event , phase ) ; } } else { //A touch with more or less than the fingers we are looking for, so cancel ret = false ; } //If we have a return value from the users handler, then return and cancel if ( ret === false ) { phase = PHASE_CANCEL ; triggerHandler ( event , phase ) ; return ret ; } else { if ( options . hold ) { holdTimeout = setTimeout ( $ . proxy ( function ( ) { //Trigger the event $element . trigger ( 'hold' , [ event . target ] ) ; //Fire the callback if ( options . hold ) { ret = options . hold . call ( $element , event , event . target ) ; } } , this ) , options . longTapThreshold ) ; } setTouchInProgress ( true ) ; } return null ; }
EVENTS  
Event handler for a touch start event.
Stops the default click event from triggering and stores where we touched
@inner
@param {object} jqEvent The normalised jQuery event object.
EVENTS Event handler for a touch start event . Stops the default click event from triggering and stores where we touched