Utility methods.
- Source:
Methods
(static) getIntersectRect() → {Object}
Computes the intersecting rect of 2 given elements. If only 1 element is
specified, the other element will default to the current viewport.
Parameters:
Type | Attributes | Description |
---|---|---|
Node |
<repeatable> |
- Source:
Returns:
Object containing width, height.
- Type
- Object
(static) getRect(element, referenceopt) → {Object}
Gets the rect of a given element or the overall rect of an array of elements.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
element |
Node | Array.<Node> | |||
reference |
Object |
<optional> |
window |
- Source:
Returns:
Object containing top, left, bottom, right, width, height.
- Type
- Object
(static) getViewportRect() → {Object}
Gets the rect of the viewport (FOV).
- Source:
Returns:
Object containing top, left, bottom, right, width, height.
- Type
- Object
(static) hitTestElement(obj, …elements) → {boolean}
Hit tests a vector or element against other elements.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
obj |
Object | Node |
Properties
|
||||||||||
elements |
Node |
<repeatable> |
- Source:
Returns:
True if test passes, false otherwise.
- Type
- boolean
(static) hitTestRect(obj, …rects) → {boolean}
Hit tests a vector or element against other elements.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
obj |
Object | Node |
Properties
|
||||||||||||||||
rects |
Object |
<repeatable> |
Properties
|
- Source:
Returns:
True if test passes, false otherwise.
- Type
- boolean
(static) transform(element, propertiesopt, constraintsopt) → {Object}
Transforms a DOM element.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
Node | Array.<Node> | Element(s) to perform the transform on. | |||||||||||||||||||||||||||||||
properties |
Object |
<optional> |
Transformation properties. (If unspecified,
all transformation styles will be reset to
'initial').
Properties
|
||||||||||||||||||||||||||||||
constraints |
Object |
<optional> |
Transformation constraints. | ||||||||||||||||||||||||||||||
contraints.width |
number |
<optional> |
Bounded width of the element. | ||||||||||||||||||||||||||||||
contraints.height |
number |
<optional> |
Bounded height of the element. |
- Source:
Returns:
Transformed properties.
- Type
- Object
(static) translate(element, propertiesopt, constraintsopt) → {Object}
Translates a DOM element.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
Node | Array.<Node> | Element(s) to perform the 3D translation. | ||||||||||||||||||||||||||
properties |
Object |
<optional> |
Translation properties (if unspecified, all
translation coordinates will be reset to 0).
Properties
|
|||||||||||||||||||||||||
constraints |
Object |
<optional> |
Translation constraints.
Properties
|
- Source:
Returns:
Translated properties.
- Type
- Object