Class $.fn.swipe



Constructor

swipe ( Mixed method ) Static
Applies TouchSwipe behaviour to one or more jQuery objects. The TouchSwipe plugin can be instantiated via this method, or methods within TouchSwipe can be executed via this method as per jQuery plugin architecture. An existing plugin can have its options changed simply by re calling .swipe(options) code »
See TouchSwipe
Parameters
method : Mixed
If the current DOMNode is a TouchSwipe object, and method is a TouchSwipe method, then the method is executed, and any following arguments are passed to the TouchSwipe method. If method is an object, then the TouchSwipe class is instantiated on the current DOMNode, passing the configuration properties defined in the object. See TouchSwipe


Instance members

Instance MethodsDefined By

Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin. code »
$("#element").swipe("destroy");
disable ( ) : DOMNode $.fn.swipe
disables the swipe plugin code »
$("#element").swipe("disable");
Returns
DOMNode
The Dom element that is now registered with TouchSwipe
enable ( ) : DOMNode $.fn.swipe
re-enables the swipe plugin with the previous configuration code »
$("#element").swipe("enable");
Returns
DOMNode
The Dom element that was registered with TouchSwipe
option ( String property, [Object value] ) : Object $.fn.swipe
Allows run time updating of the swipe configuration options. code »
$("#element").swipe("option", "threshold"); // return the threshold
$("#element").swipe("option", "threshold", 100); // set the threshold after init
$("#element").swipe("option", {threshold:100, fingers:3} ); // set multiple properties after init
$("#element").swipe({threshold:100, fingers:3} ); // set multiple properties after init - the "option" method is optional!
$("#element").swipe("option"); // Return the current options hash
Parameters
property : String
The option property to get or set, or a has of multiple options to set
value : Object
The value to set the property to
Returns
Object
If only a property name is passed, then that property value is returned. If nothing is passed the current options hash is returned.


Static members

Nested namespacesDefined By

The default configuration, and available options to configure touch swipe with. You can set the default values by updating any of the properties prior to instantiation. code »
The direction constants that are passed to the event handlers. These properties are read only, attempting to change them will not alter the values passed to the event handlers. code »
Constants representing the number of fingers used in a swipe. These are used to set both the value of fingers in the options object, as well as the value of the fingers event property. These properties are read only, attempting to change them will not alter the values passed to the event handlers. code »
The page scroll constants that can be used to set the value of allowPageScroll option These properties are read only code »
The phases that a touch event goes through. The phase is passed to the event handlers. These properties are read only, attempting to change them will not alter the values passed to the event handlers. code »

Static PropertiesDefined By

The version of the plugin code »


EventsDefined By

click ( EventObject event, DomObject target ) $.fn.swipe
A click handler triggered when a user simply clicks, rather than swipes on an element. This is deprecated since version 1.6.2, any assignment to click will be assigned to the tap handler. You cannot use on to bind to this event as the default jQ click event will be triggered. Use the tap event instead. code »
Deprecated since version 1.6.2, please use $.fn.swipe#tap instead
Parameters
event : EventObject
The original event object
target : DomObject
The element clicked on.
doubleTap ( EventObject event, DomObject target ) $.fn.swipe
A double tap handler triggered when a user double clicks or taps on an element. You can set the time delay for a double tap with the $.fn.swipe.defaults#doubleTapThreshold property. Note: If you set both doubleTap and tap handlers, the tap event will be delayed by the doubleTapThreshold as the script needs to check if its a double tap. code »
Parameters
event : EventObject
The original event object
target : DomObject
The element clicked on.
hold ( EventObject event, DomObject target ) $.fn.swipe
A hold tap handler triggered as soon as the longTapThreshold is reached You can set the time delay for a long tap with the $.fn.swipe.defaults#longTapThreshold property. code »
Parameters
event : EventObject
The original event object
target : DomObject
The element clicked on.
longTap ( EventObject event, DomObject target ) $.fn.swipe
A long tap handler triggered once a tap has been release if the tap was longer than the longTapThreshold. You can set the time delay for a long tap with the $.fn.swipe.defaults#longTapThreshold property. code »
Parameters
event : EventObject
The original event object
target : DomObject
The element clicked on.
pinchIn ( EventObject event, int direction, int distance, int duration, int fingerCount, int zoom, object fingerData ) $.fn.swipe
A handler triggered for pinch in events. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user pinched in. See $.fn.swipe.directions
distance : int
The distance the user pinched
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
zoom : int
The zoom/scale level the user pinched too, 0-1.
fingerData : object
The coordinates of fingers in event
pinchOut ( EventObject event, int direction, int distance, int duration, int fingerCount, int zoom, object fingerData ) $.fn.swipe
A handler triggered for pinch out events. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user pinched in. See $.fn.swipe.directions
distance : int
The distance the user pinched
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
zoom : int
The zoom/scale level the user pinched too, 0-1.
fingerData : object
The coordinates of fingers in event
pinchStatus ( EventObject event, int direction, int distance, int duration, int fingerCount, int zoom, object fingerData ) $.fn.swipe
A handler triggered for all pinch events. This handler is constantly fired for the duration of the pinch. This is triggered regardless of thresholds. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user pinched in. See $.fn.swipe.directions
distance : int
The distance the user pinched
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
zoom : int
The zoom/scale level the user pinched too, 0-1.
fingerData : object
The coordinates of fingers in event
swipe ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A catch all handler that is triggered for all swipe directions. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user swiped in. See $.fn.swipe.directions
distance : int
The distance the user swiped
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
swipeDown ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A handler that is triggered for "down" swipes. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user swiped in. See $.fn.swipe.directions
distance : int
The distance the user swiped
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
swipeLeft ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A handler that is triggered for "left" swipes. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user swiped in. See $.fn.swipe.directions
distance : int
The distance the user swiped
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
swipeRight ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A handler that is triggered for "right" swipes. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user swiped in. See $.fn.swipe.directions
distance : int
The distance the user swiped
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
swipeStatus ( EventObject event, string phase, string direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A handler triggered for every phase of the swipe. This handler is constantly fired for the duration of the pinch. This is triggered regardless of swipe thresholds. code »
Parameters
event : EventObject
The original event object
phase : string
The phase of the swipe event. See $.fn.swipe.phases
direction : string
The direction the user swiped in. This is null if the user has yet to move. See $.fn.swipe.directions
distance : int
The distance the user swiped. This is 0 if the user has yet to move.
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
swipeUp ( EventObject event, int direction, int distance, int duration, int fingerCount, object fingerData, string currentDirection ) $.fn.swipe
A handler that is triggered for "up" swipes. code »
Parameters
event : EventObject
The original event object
direction : int
The direction the user swiped in. See $.fn.swipe.directions
distance : int
The distance the user swiped
duration : int
The duration of the swipe in milliseconds
fingerCount : int
The number of fingers used. See $.fn.swipe.fingers
fingerData : object
The coordinates of fingers in event
currentDirection : string
The current direction the user is swiping.
tap ( EventObject event, DomObject target ) $.fn.swipe
A click / tap handler triggered when a user simply clicks or taps, rather than swipes on an element. code »
Parameters
event : EventObject
The original event object
target : DomObject
The element clicked on.