Extras Bundled JavaScript tools.


Overview

Responsive utilizes several advanced techniques in order to provide a true cross browser experience. Within the core these are exposed as jQuery functions to all the plugins and to all developers allowing them to expand upon the framework.


Transition Tools

The following methods aid with the management of CSS transitions.

$.support.transition
Returns an object with a single property .end if the browser supports CSS transitions. Otherwise; false.
$(target).redraw()
Forces the browser to repaint which will trigger a CSS transition.
$.(target).ensureTransitionEnd(duration)
Ensures that the transition end callback is triggered after the given duration in milliseconds.
$.(target).onTransitionEnd(callback)
Performs the given callback function at the end of a CSS transition.

Touch Tools

The following methods aid with the management of touch detection and support.

$.support.touchEvents
Returns true if the browser supports touch events. Otherwise; false.
$.support.pointerEvents
Returns true if the browser supports pointer events. Otherwise; false.
$.(target).swipe(options)

This plugin allows for the handling of simple swipe actions (single pointer) across multiple devices. Behaviour is normalized over both touch and pointer event specification plus mouse interation on the desktop.

Initialises the plugin with an optional options object

Name Type Description Default Value
namespace string A namespace to add to the fired evens to isolate them to a particular plugin. null
touchAction string The CSS touch-action to apply to the target. The behavior of the swipe plugin is normalized to match the property as described in the spec. "none"

The plugin exposes the following events. These can be suffixed on initialization.

swipestart
This event is fired immediately when a swipe instance is detected on pointer down. The event data contains three custom properties:
x
The horizontal position in pixels within the current viewport.
y
The vertical position in pixels within the current viewport.
time
The current Date.
swipemove
This event is fired when the pointer is moved across the surface of the device. The event data contain the custom property delta:
x
The horizontal position in pixels within the current viewport.
y
The vertical position in pixels within the current viewport.
swipeend
This event is fired immediately when on pointer up or mouse leave. The event data contains three custom properties:
delta
The horizontal and vertical position in pixels within the current viewport.
direction
The direction of the swipe: up, down, left, right.
duration
The time in milliseconds between the beginning and end of a swipe action instance.
$.(target).removeSwipe()
Forces the removal of any bound swipe functionality from the given target.