|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--PTDOMUtil
Static class containing DOM utility methods.
Usage:
PTDOMUtil.getElementLeft(elem);
Field Summary | |
<static> <final> Object |
VERSION
|
Constructor Summary | |
PTDOMUtil
()
PTDOMUtil static object constructor |
Method Summary | |
<static> Boolean
|
elementContains(containerElement, containedElement)
Checks if an element is contained within another element in the DOM hierarchy |
<static> Element
|
getElementById(id)
Wrapper for document.getElementById with performance improvements. |
<static> Number
|
getElementHeight(elm)
Gets the height of the specified element |
<static> Number
|
getElementLeft(elm)
Gets the page left position of the specified element |
<static> Number
|
getElementTop(elm)
Gets the page left position of the specified element |
<static> Number
|
getElementWidth(elm)
Gets the width of the specified element |
<static> String
|
getInnerHTML(node, formatHTML, replacementTagIdMap)
Retrieves the HTML code contained by the given node. |
<static> String
|
getOuterHTML(node, formatHTML, replacementTagIdMap)
Retrieves the HTML code from the given node. |
<static> Number
|
getWindowHeight()
Gets the height of the window |
<static> Number
|
getWindowWidth()
Gets the width of the window |
<static> void
|
insertAdjacentElement(targetElement, insertWhere, elementToInsert)
Inserts an element into the DOM at a certain position relative to a specified element. |
<static> Boolean
|
setElementOpacity(element,value)
Sets the opacity value of an element, if functionality is available |
<static> void
|
toggleVisibility(id)
This will toggle (set to none/block) display property for a div block. |
Field Detail |
<static> <final> Object VERSION
Constructor Detail |
PTDOMUtil()
Method Detail |
<static> Boolean elementContains(containerElement, containedElement)
containerElement
-
containedElement
-
<static> Element getElementById(id)
id
- id of element to retrieve (string)
<static> Number getElementHeight(elm)
elm
- the element tag to be checked.
<static> Number getElementLeft(elm)
elm
- the element tag to be checked.
<static> Number getElementTop(elm)
elm
- the element tag to be checked.
<static> Number getElementWidth(elm)
elm
- the element tag to be checked.
<static> String getInnerHTML(node, formatHTML, replacementTagIdMap)
node
- the DOM node whose contents are to be printed as HTML
formatHTML
- formats the HTML in a visually appealing manner
replacementTagIdMap
- an associative array of ids to HTML that is used to replace DOM elements with matching ids.
<static> String getOuterHTML(node, formatHTML, replacementTagIdMap)
node
- the DOM node that is to be printed as HTML
formatHTML
- formats the HTML in a visually appealing manner
<static> Number getWindowHeight()
<static> Number getWindowWidth()
<static> void insertAdjacentElement(targetElement, insertWhere, elementToInsert)
targetElement
- element relative to which another element will be inserted into the DOM
insertWhere
- 'beforeBegin' || 'afterBegin' || 'beforeEnd' || 'afterEnd': the relative position of the inserted element.
elementToInsert
- the element to insert into the DOM
<static> Boolean setElementOpacity(element,value)
element
- the element whose opacity is to be set.
value
- the precentage (0-100) of opacity
<static> void toggleVisibility(id)
id
- the id if the element to toggle visibility for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |