YAHOO.util.Dom
						
						Class YAHOO.util.Dom
Object | +--YAHOO.util.Dom
					
						
					
					class
					YAHOO.util.Dom
				
				Method Summary [top]
| void | 
											addClass
											(<String/HTMLElement/Array> el, <String> className)
										
											Adds a class name to a given element or collection of elements 
										 | 
| Object/Array | 
											batch
											(<String/HTMLElement/Array> el, <Function> method, <Any> o, <Boolean> overrideScope)
										
											Returns the element(s) that have had the supplied method applied. 
										 | 
| String/Array | 
											generateId
											(<String/HTMLElement/Array> el, <String> prefix)
										
											Generates a unique ID 
										 | 
| Object/Array | 
											get
											(<String/HTMLElement/Array> el)
										
											Returns an HTMLElement object or array of objects
										 | 
| Int | 
											getViewportHeight
											()
										
											Returns the height of the client (viewport). 
										 | 
| Int | 
											getViewportWidth
											()
										
											Returns the width of the client (viewport). 
										 | 
| Array | 
											getElementsBy
											(<Function> method, <String> tag, <String/HTMLElement> root)
										
											Returns a array of HTMLElements that pass the test applied by supplied boolean method.
 For optimized performance, include a tag and/or root node when possible.
										 | 
| Array | 
											getElementsByClassName
											(<String> className, <String> tag, <String/HTMLElement> root)
										
											Returns a array of HTMLElements with the given class.
 For optimized performance, include a tag and/or root node when possible.
										 | 
| Object | 
											getRegion
											(<String/HTMLElement/Array> el)
										
											Returns the region position of the given element. 
										 | 
| String/Array | 
											getStyle
											(<String/HTMLElement/Array> el, <String> property)
										
											Normalizes currentStyle and ComputedStyle. 
										 | 
| Int/Array | 
											getX
											(<String/HTMLElement/Array> el)
										
											Gets the current X position of the element(s) based on page coordinates. 
										 | 
| Array | 
											getXY
											(<String/HTMLElement/Array> el)
										
											Gets the current position of the element(s) based on page coordinates. 
										 | 
| Int/Array | 
											getY
											(<String/HTMLElement/Array> el)
										
											Gets the current Y position of the element(s) based on page coordinates. 
										 | 
| Boolean/Array | 
											hasClass
											(<String/HTMLElement/Array> el, <String> className)
										
											Determines whether the element(s) has the given className 
										 | 
| Boolean/Array | 
											inDocument
											(<String/HTMLElement/Array> el)
										
											Determines whether the element(s) is present in the current document 
										 | 
| Boolean | 
											isAncestor
											(haystack, needle)
										
											Determines whether an HTMLElement is an ancestor of another HTMLElement in the DOM hierarchy 
										 | 
| void | 
											removeClass
											(<String/HTMLElement/Array> el, <String> className)
										
											Removes a class name from a given element or collection of elements 
										 | 
| void | 
											replaceClass
											(<String/HTMLElement/Array> el, <String> oldClassName, <String> newClassName)
										
											Replace a class with another class for a given element or collection of elements. 
										 | 
| void | 
											setStyle
											(<String/HTMLElement/Array> el, <String> property, <String> val)
										
											Wrapper for setting style properties of HTMLElements. 
										 | 
| void | 
											setX
											(<String/HTMLElement/Array> el, <Int> x)
										
											Set the X position of the element(s) in page coordinates, regardless of how the element is positioned. 
										 | 
| void | 
											setXY
											(<String/HTMLElement/Array> el, <Array> pos, <Boolean> noRetry)
										
											Set the position of the element(s) in page coordinates, regardless of how the element is positioned. 
										 | 
| void | 
											setY
											(<String/HTMLElement/Array> el, <Int> y)
										
											Set the Y position of the element(s) in page coordinates, regardless of how the element is positioned. 
										 | 
Constructor Detail [top]
YAHOO.util.Dom
								YAHOO.util.Dom
								()
							
							Method Detail [top]
addClass
									void 
									addClass
									(<String/HTMLElement/Array> el, <String> className)
								
										
								
									
										Adds a class name to a given element or collection of elements
									
									
										
							- Parameters:
- 
													className- the class name to add to the class attribute
- 
													el- The element or collection of elements to add the class to
batch
									Object 
									batch
									(<String/HTMLElement/Array> el, <Function> method, <Any> o, <Boolean> overrideScope)
								
										
								
									
										Returns an array of elements that have had the supplied method applied.
 The method is called with the element(s) as the first arg, and the optional param as the second ( 
							method(el, o) )
									
									
										- Parameters:
- 
													method- The method to apply to the element(s)
- 
													el- (optional) An element or array of elements to apply the method to
- 
													o- (optional) An optional arg that is passed to the supplied method
- 
													overrideScope- (optional) An optional arg that allows the "o" argument to be referred to as "this" within the supplied method
- Returns:
- The element(s) with the method applied
generateId
									Object 
									generateId
									(<String/HTMLElement/Array> el, <String> prefix)
								
										
								
									
										Generates a unique ID
									
									
										
							- Parameters:
- 
													prefix- (optional) an optional prefix to use (defaults to "yui-gen")
- 
													el- (optional) An optional element array of elements to add an ID to (no ID is added if one is already present)
- Returns:
- The generated ID, or array of generated IDs (or original ID if already present on an element)
get
									Object 
									get
									(<String/HTMLElement/Array> el)
								
										
								
									
										Returns an HTMLElement reference
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID for getting a DOM reference, an actual DOM reference, or an Array of IDs and/or HTMLElements.
- Returns:
- A DOM reference to an HTML element or an array of HTMLElements.
getViewportHeight
									Int 
									getViewportHeight
									()
								
										
								
									
										Returns the height of the client (viewport).
									
									
									
										
							- Returns:
- The height of the viewable area of the page.
getViewportWidth
									Int 
									getViewportWidth
									()
								
										
								
									
										Returns the width of the client (viewport).
									
									
									
										
							- Returns:
- The width of the viewable area of the page.
getElementsBy
									Array 
									getElementsBy
									(<Function> method, <String> <String> tag, <String/HTMLElement> root)
								
										
								
									
										Returns a array of HTMLElements that pass the test applied by supplied boolean method.
 For optimized performance, include a tag and/or root node when possible.
									
									
										
							- Parameters:
- 
													method- A boolean method to test elements with
- 
													tag- (optional) The tag name of the elements being collected
- 
													root- (optional) The HTMLElement or an ID to use as the starting point
- Returns:
- An array of elements that pass the boolean method test
getElementsByClassName
									Array 
									getElementsByClassName
									(<String> className, <String> <String> tag, <String/HTMLElement> root)
								
										
								
									
										Returns a array of HTMLElements with the given class
 For optimized performance, include a tag and/or root node when possible.
									
									
										
							- Parameters:
- 
													className- The class name to match against
- 
													tag- (optional) The tag name of the elements being collected
- 
													root- (optional) An HTMLElement or an ID to use as the starting point
- Returns:
- An array of elements that have the given class name
getRegion
									Object 
									getRegion
									(<String/HTMLElement/Array> el)
								
										
								
									
										Returns the region position of the given element.
 The element must be part of the DOM tree to have a region (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
- Returns:
- A Region or array of Region instances containing "top, left, bottom, right" member data.
getStyle
									String/Array 
									getStyle
									(<String/HTMLElement/Array> el, <String> property)
								
										
								
									
										Normalizes currentStyle and ComputedStyle. Multiple word properties use camelCase (backgroundColor).
									
									
										
							- Parameters:
- 
													property- The style property whose value is returned.
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
- Returns:
- The current value of the style property for the element(s).
getX
									Int/Array 
									getX
									(<String/HTMLElement/Array> el)
								
										
								
									
										Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
- Returns:
- The X position of the element(s)
getXY
									Array 
									getXY
									(<String/HTMLElement/Array> el)
								
										
								
									
										Gets the current position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
getY
									Int/Array 
									getY
									(<String/HTMLElement/Array> el)
								
										
								
									
										Gets the current Y position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
- Returns:
- The Y position of the element(s)
hasClass
									Boolean/Array 
									hasClass
									(<String/HTMLElement/Array> el, <String> className)
								
										
								
									
										Determines whether an HTMLElement has the given className
									
									
										
							- Parameters:
- 
													className- the class name to search for
- 
													el- The element or collection to test
- Returns:
- A boolean value or array of boolean values
inDocument
									Boolean 
									inDocument
									(<String/HTMLElement/Array> el)
								
										
								
									
										Determines whether an HTMLElement is present in the current document
									
									
										
							- Parameters:
- 
													el- The element to search for
- Returns:
- Whether or not the element is present in the current document
isAncestor
									Boolean 
									isAncestor
									(<String/HTMLElement> haystack, <String/HTMLElement> needle)
								
										
								
									
										Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy
									
									
										
							- Parameters:
- 
													haystack- The possible ancestor
- 
													needle- The possible descendent
- Returns:
- Whether or not the haystack is an ancestor of needle
removeClass
									void 
									removeClass
									(<String/HTMLElement/Array> el, <String> className)
								
										
								
									
										Removes a class name from a given element or collection of elements
									
									
										
							- Parameters:
- 
													className- the class name to remove from the class attribute
- 
													el- The element or collection to remove the class from
replaceClass
									void 
									replaceClass
									(<String/HTMLElement/Array> el, <String> oldClassName, <String> newClassName)
								
										
								
									
										Replace a class with another class for a given element or collection of elements.
 If no oldClassName is present, the newClassName is simply added.
									
									
										
							- Parameters:
- 
													oldClassName- the class name to be replaced
- 
													newClassName- the class name that will be replacing the old class name
- 
													el- The element or collection to remove the class from
setStyle
									void 
									setStyle
									(<String/HTMLElement/Array> el, <String> property, <String> val)
								
										
								
									
										Wrapper for setting style properties of HTMLElements.  Normalizes "opacity" across modern browsers.  Multiple word properties use camelCase (backgroundColor).
									
									
										
							- Parameters:
- 
													property- The style property to be set.
- 
													val- The value to apply to the given property.
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
setX
									void 
									setX
									(<String/HTMLElement/Array> el, <Int> x)
								
										
								
									
										Set the X position of an html element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													x- to use as the X coordinate for the element(s).
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
setXY
									void 
									setXY
									(<String/HTMLElement/Array> el, <Array> pos, <Boolean> noRetry)
								
										
								
									
										Set the position of an html element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													pos- Contains X & Y values for new position (coordinates are page-based)
- 
													noRetry- By default we try and set the position a second time if the first fails
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
setY
									void 
									setY
									(<String/HTMLElement/Array> el, <Int> y)
								
										
								
									
										Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (elements with display = none or not appended to document return false).
									
									
										
							- Parameters:
- 
													el- Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
- 
													x- to use as the Y coordinate for the element(s).