Module

base/utils/dom

Classes

Scroller
Sheet

Members

String

static animationEndEvent

Name of the animationend event.

View Source utils/dom.js, line 14

String

static transitionEndEvent

Name of the transitionend event.

View Source utils/dom.js, line 20

Methods

static $(selector, element) → {Element}

Return first element in page by given selector.
Parameters:
Name Type Description
selector String
element Element

View Source utils/dom.js, line 29

Element

static $$(selector, element) → {Array.<Element>}

Return all elements in page by given selector as array.
Parameters:
Name Type Description
selector String
element Element

View Source utils/dom.js, line 40

Array.<Element>

static children(element, skipElement) → {Array.<Element>}

Return child elements.
Parameters:
Name Type Description
element Element Element to get the children from.
skipElement Element Element to skip.

View Source utils/dom.js, line 116

Array.<Element>

static computedStyle(element, prop, pseudoElementopt) → {String}

Shortcut for get a computed style.
Parameters:
Name Type Attributes Default Description
element Element Element to get computed style from.
prop Element Style to get.
pseudoElement String | null <optional>
null String for pseudo element.

View Source utils/dom.js, line 104

Computed style
String

static computedStyles(element, pseudoElementopt) → {Object}

Return all computed styles.
Parameters:
Name Type Attributes Default Description
element Element Element to get computed styles from.
pseudoElement String | null <optional>
null String for pseudo element.

View Source utils/dom.js, line 80

Computed styles
Object

static index(element) → {Integer}

Return index of current element.
Parameters:
Name Type Description
element Element Element

View Source utils/dom.js, line 193

Integer

static outerHeight(element) → {Number}

Return outerWidth of given element.
Parameters:
Name Type Description
element Element Target element.

View Source utils/dom.js, line 50

Number

static outerWidth(element) → {Number}

Return outerWidth of given element.
Parameters:
Name Type Description
element Element Target element.

View Source utils/dom.js, line 64

Number

static parent(element, match) → {Element}

Return matching parent.
Parameters:
Name Type Description
element Element Target element to get the parent from.
match function The match function to check the parent agains.

View Source utils/dom.js, line 147

Element

static parents(element, matchopt) → {Array.<Element>}

Return parent elements of given element.
Parameters:
Name Type Attributes Description
element Element Target element to get the parents from.
match function <optional>
The match function to check the parent against.

View Source utils/dom.js, line 171

Array.<Element>

static scrollX() → {Integer}

Return horizontal scroll position page.

View Source utils/dom.js, line 236

Integer

static scrollY() → {Integer}

Return vertical scroll position of page.

View Source utils/dom.js, line 228

Integer

static siblings(element) → {Array.<Element>}

Return siblings of given element.
Parameters:
Name Type Description
element Element Target element.

View Source utils/dom.js, line 135

Array.<Element>

static style(element, styles, rememberopt) → {Object|Object}

Set style attributes.
Parameters:
Name Type Attributes Default Description
element Element Target element.
styles Object Styles to set.
remember Boolean <optional>
false Whether to return original attributes.

View Source utils/dom.js, line 209

Original style attributes which got overwritten.
Object | Object