DOM module.
Classes
Members
Methods
static $(selector, element) → {Element}
Return first element in page by given selector.
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | |
element |
Element |
Element
static $$(selector, element) → {Array.<Element>}
Return all elements in page by given selector as array.
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | |
element |
Element |
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. |
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. |
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. |
Computed styles
Object
static index(element) → {Integer}
Return index of current element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | Element |
Integer
static outerHeight(element) → {Number}
Return outerWidth of given element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | Target element. |
Number
static outerWidth(element) → {Number}
Return outerWidth of given element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | Target element. |
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. |
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. |
Array.<Element>
static scrollX() → {Integer}
Return horizontal scroll position page.
Integer
static scrollY() → {Integer}
Return vertical scroll position of page.
Integer
static siblings(element) → {Array.<Element>}
Return siblings of given element.
Parameters:
Name | Type | Description |
---|---|---|
element |
Element | Target element. |
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. |
Original style attributes which got overwritten.
Object
|
Object