Methods
-
<static> addListener(element, eventType, fn)
-
Add a set of event listener to an element
Parameters:
Name Type Description elementElement eventTypestring | Array.<string> fnfunction -
<static> appendText(element, text)
-
Append text into an elemnt
Parameters:
Name Type Description elementElement textstring text content
-
<static> create(tagName, options)
-
Create an element
Parameters:
Name Type Description tagNamestring The element tag, use 'TEXT' to create a text node
options* Properties
Name Type Argument Description classNamestring className The element class name
parentElement Parent to append the element as child
htmlElement | string <optional>
Content of the element (if text is not set)
textstring <optional>
Text content (if html is not set)
optionsElement | string <optional>
when tagName = SELECT a list of options as key:value to add to the select
*string Any other attribut to add to the element
-
<static> createCheck(options)
-
Create a toggle switch input
Parameters:
Name Type Description options* Properties
Name Type Argument Default Description htmlstring | Element afterstring | Element namestring <optional>
input name
typestring <optional>
checkbox input type: radio or checkbox
valuestring input value
on* <optional>
a list of actions
clickfunction <optional>
changefunction <optional>
parentElement -
<static> createSwitch(options)
-
Create a toggle switch input
Parameters:
Name Type Description options* Properties
Name Type Argument Description htmlstring | Element afterstring | Element checkedboolean on* <optional>
a list of actions
clickfunction <optional>
changefunction <optional>
parentElement -
<static> dispatchEvent(eventName, element)
-
Dispatch an event to an Element
Parameters:
Name Type Description eventNamestring elementElement -
<static> getFixedOffset(elt)
-
Get element offset
Parameters:
Name Type Description eltELement Returns:
top/left offset
- Type
- Object
-
<static> getStyle(el, styleProp)
-
Get style propertie of an element
Parameters:
Name Type Description elDOMElement the element
stylePropstring Propertie name
Returns:
style value
- Type
- *
-
<static> hidden(element)
-
Test if an element is hihdden
Parameters:
Name Type Description elementElement Returns:
- Type
- boolean
-
<static> hide(element)
-
Hide an element
Parameters:
Name Type Description elementElement -
<static> offsetRect(elt)
-
Get element offset rect
Parameters:
Name Type Description eltDOMElement Returns:
- Type
- *
-
<static> outerHeight(elt)
-
Get outerHeight of an elemen
Parameters:
Name Type Description eltDOMElement Returns:
- Type
- number
-
<static> outerWidth(elt)
-
Get outerWidth of an elemen
Parameters:
Name Type Description eltDOMElement Returns:
- Type
- number
-
<static> positionRect(elt, fixed)
-
Get element offset rect
Parameters:
Name Type Description eltDOMElement fixedboolean get fixed position
Returns:
- Type
- Object
-
<static> removeListener(element, eventType, fn)
-
Add a set of event listener to an element
Parameters:
Name Type Description elementElement eventTypestring | Array.<string> fnfunction -
<static> scrollDiv(elt, options)
-
Make a div scrollable without scrollbar. On touch devices the default behavior is preserved
Parameters:
Name Type Description eltDOMElement options* Properties
Name Type Argument Default Description onmovefunction <optional>
a function that takes a boolean indicating that the div is scrolling
verticalboolean <optional>
false animateboolean <optional>
true add kinetic to scroll
mousewheelboolean <optional>
false enable mousewheel to scroll
minibarboolean <optional>
false add a mini scrollbar to the parent element (only vertical scrolling)
Returns:
an object with a refresh function
- Type
- Object
-
<static> setCursor(elt, cursor)
-
Set cursor
Parameters:
Name Type Description eltElement | ol/Map cursorstring -
<static> setHTML(element, html)
-
Set inner html or append a child element to an element
Parameters:
Name Type Description elementElement htmlElement | string Content of the element
-
<static> setStyle(el, st)
-
Set style of an element
Parameters:
Name Type Description elDOMElement the element
st* list of style
-
<static> show(element)
-
Show an element
Parameters:
Name Type Description elementElement -
<static> toggle(element)
-
Toggle an element
Parameters:
Name Type Description elementElement