Class: Element

Element(elem)

Represents an HTML element.

Constructor

new Element(elem)

Parameters:
Name Type Description
elem string one of possible HTML elements
Source:

Classes

Element

Members

elem

Gets the HTML element.
Source:

elem

Sets the HTML element.
Source:

id

Gets id of this element.
Source:

innerHTML

Sets the innerHTML.
Source:

innerHTML

Gets the innerHTML.
Source:

innerText

Sets the innerText.
Source:

outerHTML

Gets the outerHTML.
Source:

parent

Sets element's parent.
Source:

parent

Gets element's parent.
Source:

style

Gets element style property.
Source:

Methods

addAnimation(name, duration, timingFunction, delay, iterationCount, direction, fillMode, playState) → {Element}

Adds CSS animation to this element.
Parameters:
Name Type Description
name string
duration string
timingFunction string
delay string
iterationCount string
direction string
fillMode string
playState string
Source:
Returns:
this
Type
Element

addClasses(…classes) → {Element}

Adds classes.
Parameters:
Name Type Attributes Description
classes string <repeatable>
Source:
Returns:
this
Type
Element

addTransition(property, duration, timingFunction, delay) → {Element}

Adds CSS transition to this element.
Parameters:
Name Type Description
property string
duration string
timingFunction string
delay string
Source:
Returns:
this
Type
Element

appendChild(child) → {Element}

Appends an Element as a child.
Parameters:
Name Type Description
child Element
Source:
Returns:
this
Type
Element

backgroundColor(c) → {Element}

Sets a background color.
Parameters:
Name Type Description
c string
Source:
Returns:
this
Type
Element

backgroundImage(imageBase64, backgroundSize, aspectRatio) → {Element}

Sets a background image in base64.
Parameters:
Name Type Description
imageBase64 string
backgroundSize string a CSS background-size property value
aspectRatio string | number CSS aspect-ratio property
Source:
Returns:
this
Type
Element

center() → {Element}

Horizontally centers this element.
Source:
Returns:
this
Type
Element

color(c) → {Element}

Sets a color.
Parameters:
Name Type Description
c string
Source:
Returns:
this
Type
Element

cursor(type) → {Element}

Sets the cursor type.
Parameters:
Name Type Description
type string one of HTML supported types
Source:
Returns:
this
Type
Element

display(d) → {Element}

Sets CSS display property.
Parameters:
Name Type Description
d string
Source:
Returns:
this
Type
Element

filter(filter) → {Element}

Sets a CSS filter.
Parameters:
Name Type Description
filter string CSS filter
Source:
Returns:
this
Type
Element

hide() → {Element}

Changes the visibility to "hidden".
Source:
Returns:
this
Type
Element

maxHeight(mh) → {Element}

Sets CSS max height property.
Parameters:
Name Type Description
mh string
Source:
Returns:
this
Type
Element

maxWidth(mw) → {Element}

Sets CSS max width property.
Parameters:
Name Type Description
mw string
Source:
Returns:
this
Type
Element

minHeight(mh) → {Element}

Sets CSS min height property.
Parameters:
Name Type Description
mh string
Source:
Returns:
this
Type
Element

minWidth(mw) → {Element}

Sets CSS min width property.
Parameters:
Name Type Description
mw string
Source:
Returns:
this
Type
Element

onClick(fun) → {Element}

Binds a function for the onclick event.
Parameters:
Name Type Description
fun function | null the onclick callback. If null removes the callback
Source:
Returns:
this
Type
Element

onMouseLeave(fun) → {Element}

Binds a function for the onmouseleave event.
Parameters:
Name Type Description
fun function
Source:
Returns:
this
Type
Element

onMouseOver(fun) → {Element}

Binds a function for the onmouseover event.
Parameters:
Name Type Description
fun function
Source:
Returns:
this
Type
Element

onUpdate(fun) → {Element}

Binds a function for the update event.
Parameters:
Name Type Description
fun function
Source:
Returns:
this
Type
Element

onWheel(fun) → {Element}

Binds a function for the onwheel event.
Parameters:
Name Type Description
fun function
Source:
Returns:
this
Type
Element

print() → {Element}

Prints the HTML content of this Element.
Source:
Returns:
this
Type
Element

remove() → {Element}

Removes this Element.
Source:
Returns:
this
Type
Element

removeChild(child) → {Element}

Removes the specified child.
Parameters:
Name Type Description
child Element
Source:
Returns:
this
Type
Element

removeClasses(…classes) → {Element}

Removes classes.
Parameters:
Name Type Attributes Description
classes string <repeatable>
Source:
Returns:
this
Type
Element

replace(elem) → {Element}

Replaces in parent this Element with the input Element.
Parameters:
Name Type Description
elem Element
Source:
Returns:
this
Type
Element

setTooltip(text) → {Element}

Sets tooltip.
Parameters:
Name Type Description
text string tooltip
Source:
Returns:
this
Type
Element

show() → {Element}

Changes the visibility to "visible".
Source:
Returns:
this
Type
Element

size(width, height) → {Element}

Sets element size.
Parameters:
Name Type Description
width string
height string
Source:
Returns:
this
Type
Element

startUpdate(millis) → {Element}

Starts the update loop. On each cycle will be invoked the function specified with onUpdate method.
Parameters:
Name Type Description
millis number interval time in milliseconds between two cycles
Source:
Returns:
this
Type
Element

stopUpdate() → {Element}

Stops the update loop.
Source:
Returns:
this
Type
Element

zIndex(z) → {Element}

Sets z-index property.
Parameters:
Name Type Description
z number
Source:
Returns:
this
Type
Element