new domhelper()
A module that adds simple dom utility functionality.
- Source:
Methods
-
<static> closetElement(element) → {node}
-
Returns cloaset DOM element.
Parameters:
Name Type Description element
node html dom element
- Source:
Returns:
- closet node element
- Type
- node
-
<static> elementContentWrapInner(element, innerElement)
-
Wraps inner elements
Parameters:
Name Type Description element
node html dom element
innerElement
node element to wrap html dom element
- Source:
-
<static> elementHideCss(element)
-
Hides DOM elements.
Parameters:
Name Type Description element
node html dom element
- Source:
-
<static> elementShowCss(element)
-
Shows DOM elements.
Parameters:
Name Type Description element
node html dom element
- Source:
-
<static> elementWrap(element, wrapperElement)
-
Wraps element with wrapper
Parameters:
Name Type Description element
node html dom element
wrapperElement
node element to wrap html dom element
- Source:
-
<static> getElementSelector(element) → {string}
-
get element selector
Parameters:
Name Type Description element
node html dom element
- Source:
Returns:
query selector string
- Type
- string
-
<static> getHighIndex(selector) → {number}
-
returns the highest zindex
Parameters:
Name Type Description selector
string query selector
- Source:
Returns:
highest z-index
- Type
- number
-
<static> getParentElement(element, selector, selectorType)
-
get parent element
Parameters:
Name Type Description element
node html dom element
selector
string selector
selectorType
string selector type (id or class)
- Source:
-
<static> getPosition(element) → {object}
-
get scroll position of element
Parameters:
Name Type Description element
node html dom element
- Source:
Returns:
position element
- Type
- object
-
<static> getScrollTop(element) → {number}
-
get scroll position of element
Parameters:
Name Type Description element
node html dom element
- Source:
Returns:
position of scroll
- Type
- number
-
<static> nodeIndexOfNodeList(nodelist, element) → {number}
-
converts idnex of node in nodelist
Parameters:
Name Type Description nodelist
object html dom element
element
object html dom element
- Source:
Returns:
index of element in nodelist
- Type
- number
-
<static> nodelistToArray(nl) → {array}
-
converts nodelists to arrays
Parameters:
Name Type Description nl
node html dom element
- Source:
Returns:
array of html nodes
- Type
- array
-
<static> removeAllClassAndToggle(elementCollection, element, name)
-
toggles class across nodelist/elementcollection
Parameters:
Name Type Description elementCollection
object html dom element
element
object html dom element
name
string of class!
- Source:
-
<static> removeElement(elementCollection)
-
removes element from dom
Parameters:
Name Type Description elementCollection
object html dom element
- Source: