The Augmented.js Next - Presentation Dom Module.
npm install presentation-domAugmented.js Presentation Dom Module
- $
- Examples
- Dom
- getViewportHeight
- getViewportWidth
- setValue
- Parameters
- getValue
- Parameters
- selector
- Parameters
- selectors
- Parameters
- query
- Parameters
- hide
- Parameters
- show
- Parameters
- setClass
- Parameters
- addClass
- Parameters
- removeClass
- Parameters
- replaceClass
- Parameters
- containsClass
- Parameters
- toggleClass
- Parameters
- empty
- Parameters
- injectTemplate
- Parameters
- stringToHTML
- Parameters
- getAttributes
- Parameters
- createDOMMap
- Parameters
- addAttributes
- Parameters
- diffAtts
- Parameters
- makeElem
- Parameters
- diff
- Parameters
Augmented jQuery-like selectors usinge native selectors</br/>
Will return a nodelist for all selections unless only one is found.
``javascript`
$("#myElement");
$("section#main header");
- or start from Element:
$("header", mainSectionEl);
DOM related functions
Gets the height of the browser viewport
Returns number The height of the viewport
Gets the width of the browser viewport
Returns number The width of the viewport
Sets the value of an element
Will detect the correct method to do so by element type
#### Parameters
- el (string \| Node) el Element or string of element selectorvalue
- string Value to set (or HTML)onlyText
- boolean Value will set as text only
Gets the value of an element
Will detect the correct method to do so by element type
#### Parameters
- el (string \| Node) el Element or string of element selector
Returns string Returns the value of the element (or HTML)
Selector function
Supports full query selection
#### Parameters
- query string Element or string of element selector
Returns Node Returns the element (or first of type)
Selectors function
Supports full query selection
#### Parameters
- query string Element or string of element selector
Returns NodeList Returns all the nodes selected
Query function
Supports full query selection but acts like jQuery
#### Parameters
- query string Element or string of element selectorel
- (string \| Node) el Element to start from (optional)
Returns (NodeList \| Node) Returns all the nodes selected
Hides an element
#### Parameters
- el (string \| Node) el Element or string of element selector
Shows an element
#### Parameters
- el (string \| Node) el Element or string of element selectordisplay
- string Value to set for "display" property (optional)
Sets the class attribute (completely)
#### Parameters
- el (string \| Node) el Element or string of element selectorcls
- string the class value
Adds a class attribute
#### Parameters
- el (string \| Node) el Element or string of element selectorcls
- string the class value
Remove a class attribute
#### Parameters
- el (string \| Node) el Element or string of element selectorcls
- string the class value
Replace a class attribute with a new one
#### Parameters
- el (string \| Node) el Element or string of element selectoroldCls
- string the old class valuenewCls
- string the new class value
Returns true if it contains the class
#### Parameters
- el (string \| Node) Element or string of element selectorcls
- string the class value
Returns boolean Returns true is contains class
Toggle class on element
#### Parameters
- el (string \| Node) Element or string of element selectorcls
- string the class
Empty a element container
#### Parameters
- el (string \| Node) Element or string of element selector
injectTemplate method - Injects a template element at a mount point
#### Parameters
- template string The template selectormount
- Node The mount point as Document.Element or String
Convert a template string into HTML DOM nodes
- str String The template string
Returns Node The template HTML
Create an array of the attributes on an element
- attributes NamedNodeMap The attributes on an element
Returns Array The attributes on an element as an array of key/value pairs
Create a DOM Tree Map for an element
- element Node The element to mapisSVG
- Boolean If true, node is within an SVG
Returns Array A DOM tree map
Add attributes to an element
- elem Node The elementatts
- Array The attributes to add
Diff the attributes on an existing element versus the template
- template Object The new templateexisting
- Object The existing DOM node
Make an HTML element
- elem Object The element details
Returns Node The HTML element
Diff the existing DOM node versus the template
- templateMap Array A DOM tree map of the template contentdomMap
- Array A DOM tree map of the existing DOM nodeelem` Node The element to render content into
-