Gestures Summary
The jQuery Gestures project is a plugin that brings simple guesture support to the mouse.
In this demo, drag within the gray zone to create a gesture. You can use eight compass points, N, NE, E, SE, S, SW, W, NW.
The gesture must start and end within the "gesture" element - but you can apply this to the entire document as well as individual elements.
This version also supports composite gestures, which combine several compass directions to create a shape. This gives gestures many more variations than the eight compass points.
On the box below, try drawing a box shape, or just a simple line to see the plugin in action.
Options
- classModifier
- Used to apply class names to the elements created by the plugin. You only need to specify a class modifier if you have a name-clash.
- tolerance
- The amount of movement to ignore (default 25)
- startEvent
- The event to start the gesture tracking (default "mousedown")
- endEvent
- The event to end the gesture tracking (default "mouseup")
- advancedShapes
- Whether to track advanced shapes (default false)
- shapeSpeed
- The interval for advanced shape tracking (default 200)
- showTrail
- Whether to show a trail while tracking (default false)
- trailSpeed
- The interval for trail tracking (default 50)
- eventLimit
- Time limit for each event (default 5000)
- eventHandler
- A function to execute when an event fires, accepting argument of eventName (called on each event within an advanced shape)
- eventHandlerAdvanced
- A function to execute when an advanced event fires, accepting argument of directions (array)