Namespace: element

ol.ext. element

Methods


<static> addListener(element, eventType, fn)

Add a set of event listener to an element

Parameters:
Name Type Description
element Element
eventType string | Array.<string>
fn function

<static> appendText(element, text)

Append text into an elemnt

Parameters:
Name Type Description
element Element
text string

text content


<static> create(tagName, options)

Create an element

Parameters:
Name Type Description
tagName string

The element tag, use 'TEXT' to create a text node

options *
Properties
Name Type Argument Description
className string

className The element class name

parent Element

Parent to append the element as child

html Element | string <optional>

Content of the element (if text is not set)

text string <optional>

Text content (if html is not set)

options Element | 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
html string | Element
after string | Element
name string <optional>

input name

type string <optional>
checkbox

input type: radio or checkbox

value string

input value

on * <optional>

a list of actions

click function <optional>
change function <optional>
parent Element

<static> createSwitch(options)

Create a toggle switch input

Parameters:
Name Type Description
options *
Properties
Name Type Argument Description
html string | Element
after string | Element
checked boolean
on * <optional>

a list of actions

click function <optional>
change function <optional>
parent Element

<static> dispatchEvent(eventName, element)

Dispatch an event to an Element

Parameters:
Name Type Description
eventName string
element Element

<static> getFixedOffset(elt)

Get element offset

Parameters:
Name Type Description
elt ELement
Returns:

top/left offset

Type
Object

<static> getStyle(el, styleProp)

Get style propertie of an element

Parameters:
Name Type Description
el DOMElement

the element

styleProp string

Propertie name

Returns:

style value

Type
*

<static> hidden(element)

Test if an element is hihdden

Parameters:
Name Type Description
element Element
Returns:
Type
boolean

<static> hide(element)

Hide an element

Parameters:
Name Type Description
element Element

<static> offsetRect(elt)

Get element offset rect

Parameters:
Name Type Description
elt DOMElement
Returns:
Type
*

<static> outerHeight(elt)

Get outerHeight of an elemen

Parameters:
Name Type Description
elt DOMElement
Returns:
Type
number

<static> outerWidth(elt)

Get outerWidth of an elemen

Parameters:
Name Type Description
elt DOMElement
Returns:
Type
number

<static> positionRect(elt, fixed)

Get element offset rect

Parameters:
Name Type Description
elt DOMElement
fixed boolean

get fixed position

Returns:
Type
Object

<static> removeListener(element, eventType, fn)

Add a set of event listener to an element

Parameters:
Name Type Description
element Element
eventType string | Array.<string>
fn function

<static> scrollDiv(elt, options)

Make a div scrollable without scrollbar. On touch devices the default behavior is preserved

Parameters:
Name Type Description
elt DOMElement
options *
Properties
Name Type Argument Default Description
onmove function <optional>

a function that takes a boolean indicating that the div is scrolling

vertical boolean <optional>
false
animate boolean <optional>
true

add kinetic to scroll

mousewheel boolean <optional>
false

enable mousewheel to scroll

minibar boolean <optional>
false

add a mini scrollbar to the parent element (only vertical scrolling)

Returns:

an object with a refresh function

Type
Object

<static> setHTML(element, html)

Set inner html or append a child element to an element

Parameters:
Name Type Description
element Element
html Element | string

Content of the element


<static> setStyle(el, st)

Set style of an element

Parameters:
Name Type Description
el DOMElement

the element

st *

list of style


<static> show(element)

Show an element

Parameters:
Name Type Description
element Element

<static> toggle(element)

Toggle an element

Parameters:
Name Type Description
element Element