Library: nornix.js
Overview
Constructors
Namespaces
Nornix.events
Namespace for Event functions
methods
  • add(obj, type, fn, capture)
  • remove(obj, type, fn, capture)
Nornix.cookies
Namespace for Cookie functions
methods
Nornix.css
Namespace for CSS functions.
methods
  • swap(el, oldstr, newstr)
  • add(el, className)
Nornix.dom
Namespace for DOM functions.
methods
Nornix.util
Namespace for Utility functions.
methods
properties
Functions
Nornix.events.add(obj, type, fn, capture)
Function to add events to objects.
parameters
Object obj object to add the event to
String type event type, like "load", "click"
Function fn the function that should be run when the event fires
boolean capture if true, indicates that the user wishes to initiate capture
Nornix.events.remove(obj, type, fn, capture)
Function to remove events from objects. You should use the same parameters as in {@link event#addEvent} to remove the same event listener.
parameters
Object obj object to add the event to
String type event type, like "load", "click"
Function fn the function that should be run when the event fires
boolean capture if true, indicates that the user wishes to initiate capture
Nornix.events.cancel(e, c)
Function to stop normal browser action on events. Function you can call within your event handlers to stop them performing the normal browser action or kill the event entirely.
parameters
Event e the event object
boolean c set to true to cancel event bubbling
Nornix.events.delayedInit(id, initFunc, interval)
Function to run an initialization after an element has became available in the DOM. The element will be sent to the initializing function as an object.
parameters
String id ID of element to wait for
Function initFunc the function that should be run when the element is available
number interval time in milliseconds
Nornix.cookies.create(name, value, days)
Function to create a browser cookie.
parameters
String name name of cookie
String value value of cookie
Number days number of days browser should save the cookie
Nornix.cookies.read(name)
Function to read a browser cookie.
parameters
String name name of cookie
returns
value of cookie
Nornix.cookies.erase(name)
Function to erase a browser cookie.
parameters
String name name of cookie
Nornix.css.swap(el, oldstr, newstr)
Function to swap, remove or add a class name on an object.
parameters
HTMLElement el the object to work on
String oldstr the old class -- set to null to add class
String newstr the new class -- leave empty to remove class
Nornix.css.add(el, className)
Function to add a class name on an object.
parameters
HTMLElement el the object to work on
String className the new class
Nornix.css.remove(el, className)
Function to remove a class name from an object.
parameters
HTMLElement el the object to work on
String className class to remove
Nornix.css.contains(el, s)
Check if class exists on element.
parameters
HTMLElement el the object to work on
String s class name
returns
true if the class exists
Nornix.css.getPos(obj)
Get position of node.
parameters
HTMLElement obj the object to work on
returns
absolute position as .x and .y of return value.
Nornix.css.getProperty(el, styleProp)
Get current style of element.
parameters
HTMLElement el element to get the style from
String styleProp CSS style propterty to fetch
returns
current setting of style property
Nornix.css.prop2Js(p)
Convert CSS property to JS equivalent.
parameters
String p property to convert
returns
JS property
Nornix.dom.live2copy(collection)
Create static copy of a live collection. This makes it much faster to work with the elements.
parameters
HTMLCollection collection a live collection
returns
static copy of the live collection
Nornix.dom.getTextContent(node)
Function that reads the text content of a DOM node. IE FIX for .textContent
parameters
Node node DOM node to get text content from
returns
text content of node
Nornix.dom.imagePreload(imgs, path)
Preload image files for faster rendering.
parameters
Array imgs array of images
String path path to images
Nornix.dom.findChildOfType(nodes, nodeName, nodeAction, backwards)
Find first or last children of element type.
parameters
HTMLElement nodes node, which children nodes will be searched
String nodeName type of HTML element we are looking for
Function nodeAction closure for action to execute
boolean backwards search from the end of the child list when true
returns
value of action closure.
Nornix.dom.eqNodeName(el, nodeName)
Check if node name of element is equal to a string.
parameters
HTMLElement el the object to work on
String nodeName
returns
true if the node name is equivalent
Nornix.util.trim(s)
String function that removes whitespace from the start and end of a string.
parameters
String s the string to use
returns
String the string with whitespace removed
Objects
boolean Nornix.util.isIe
True when browser is Internet Exlorer.
Generated by JsDoc Toolkit 1.4.1b on Wed, 14 May 2008 21:00:44 GMT.