Home Reference Source

Function

Static Public Summary
public

closest(element: Element, selector: String | Function): Element | null

Get the closest parent element of a given element that matches the given selector string or matching function

public

distance(x1: Number, y1: Number, x2: Number, y2: Number): Number

Returns the distance between two points

public

requestNextAnimationFrame(callback: *): *

public

touchCoords(event: TouchEvent): Touch

Returns the first touch event found in touches or changedTouches of a touch events.

Static Public

public closest(element: Element, selector: String | Function): Element | null source

Get the closest parent element of a given element that matches the given selector string or matching function

Params:

NameTypeAttributeDescription
element Element

The child element to find a parent of

selector String | Function

The string or function to use to match the parent element

Return:

Element | null

public distance(x1: Number, y1: Number, x2: Number, y2: Number): Number source

Returns the distance between two points

Params:

NameTypeAttributeDescription
x1 Number

The X position of the first point

y1 Number

The Y position of the first point

x2 Number

The X position of the second point

y2 Number

The Y position of the second point

Return:

Number

public requestNextAnimationFrame(callback: *): * source

Params:

NameTypeAttributeDescription
callback *

Return:

*

public touchCoords(event: TouchEvent): Touch source

Returns the first touch event found in touches or changedTouches of a touch events.

Params:

NameTypeAttributeDescription
event TouchEvent

a touch event

Return:

Touch

a touch object