graphic-canvas-example-starfield-dom.js / js
Ara's JavaScript Library: DOM
spanify receives a DOM node reference (or an ID to one), iterates over all of it's child nodes and wraps each character of the text nodes that it encounters with a span. By default only first level text nodes are processed. It can deep scan however and process all child text nodes. It returns nothing as it directly modifies the DOM.
parameter: {String/Object} el An element ID or element reference in the DOM
parameter: {Bool} deep (Optional), default is false. If true, all child nodes will be spanified. If false, then only first level text nodes will be spanified.
getElement receives an element of unknown type and determines whether it's an element ID or a reference to an element in the DOM. If it's an ID it fetches and returns a reference to the element in the DOM with that ID. If it's a reference to an element in the DOM it just returns it without doing anything.
parameter: {String/Object} el An element ID or element reference in the DOM
returns: {Object}
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.