webgui/www/extras/yui/docs/dom/YAHOO.util.Dom.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

1404 lines
37 KiB
HTML

<html>
<head>
<title>
JavaScript Documentation -
YAHOO.util.Dom
</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>JavaScript Documentation</h1>
<h3><a href="./index.html">Dom Utility</a></h3>
<div class="breadcrumbs">
<a href="./index.html">Dom Utility</a>
&gt;
<strong>YAHOO.util.Dom</strong>
</div>
</div>
<div id="body">
<div class="nav">
<div class="module resources">
<ul class="content">
<li><a href="overview-tree.html">Tree View</a></li>
<li><a href="index-all.html">Element Index</a></li>
</ul>
</div>
<div class="module">
<h4><a href="./allclasses-noframe.html">Classes</a></h4>
<ul class="content">
<li>
<a href="YAHOO.util.Dom.html">
YAHOO.util.Dom</a>
</li>
<li>
<a href="YAHOO.util.Point.html">
YAHOO.util.Point</a>
</li>
<li>
<a href="YAHOO.util.Region.html">
YAHOO.util.Region</a>
</li>
</ul>
</div>
<div class="module">
<h4><a href="./overview-summary.html">Files</a></h4>
<ul class="content">
<li>
<a href="overview-summary-Dom.js.html">
Dom.js</a>
</li>
<li>
<a href="overview-summary-Region.js.html">
Region.js</a>
</li>
</ul>
</div>
</div>
<div id="pri">
<div class="main">
<h2>Class YAHOO.util.Dom</h2>
<pre>Object
|
+--<b>YAHOO.util.Dom</b>
</pre>
<hr />
<!-- Class definition -->
<div class="class-def">
<div class="class-name">
<span class="class-attribs">
</span>
<span class="class-type">class</span>
<b>YAHOO.util.Dom</b>
</div>
<div class="class-extends">
</div>
</div>
<div class="meta">
<div class="summary">
<p>
Provides helper methods for DOM elements.
</p>
</div>
</div>
<!-- ======== QUICK LINKS ======== -->
<div class="quick-links">
<strong>Quick Links:</strong>&nbsp;
<a href="#constructor_summary">Constructor Summary</a>
|
<a href="#methodSummary">Method Summary</a> |
<a href="#constructorDetails">Constructor Details</a>
|
<a href="#methodDetails">Method Details</a>
</div>
<!-- ======== END QUICK LINKS ======== -->
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- ======== END NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- =========== END FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<div class="section contructor summaries">
<h3><a name="constructor_summary">Constructor Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<code class="spec">
<a href="YAHOO.util.Dom.html#YAHOO.util.Dom()">YAHOO.util.Dom</a>
</code>
<div class="description">
&nbsp;
</div>
</div>
</div>
<!-- ======== END CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<div class="section method summaries">
<h3><a name="methodSummary">Method Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#addClass">addClass</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Adds a class name to a given element or collection of elements&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object/Array</td>
<td class="spec">
<code>
<a href="#batch">batch</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;Function&gt; method, &lt;Any&gt; o, &lt;Boolean&gt; overrideScope)
</code>
<div class="description">
Returns the element(s) that have had the supplied method applied.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">String/Array</td>
<td class="spec">
<code>
<a href="#generateId">generateId</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; prefix)
</code>
<div class="description">
Generates a unique ID&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object/Array</td>
<td class="spec">
<code>
<a href="#get">get</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Returns an HTMLElement object or array of objects
</div>
</td>
</tr>
<tr>
<td class="flags">Int</td>
<td class="spec">
<code>
<a href="#getViewportHeight">getViewportHeight</a>
()
</code>
<div class="description">
Returns the height of the client (viewport).&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Int</td>
<td class="spec">
<code>
<a href="#getViewportWidth">getViewportWidth</a>
()
</code>
<div class="description">
Returns the width of the client (viewport).&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Array</td>
<td class="spec">
<code>
<a href="#getElementsBy">getElementsBy</a>
(&lt;Function&gt; method, &lt;String&gt; tag, &lt;String/HTMLElement&gt; root)
</code>
<div class="description">
Returns a array of HTMLElements that pass the test applied by supplied boolean method.
For <strong>optimized performance</strong>, include a <strong>tag</strong> and/or <strong>root node</strong> when possible.
</div>
</td>
</tr>
<tr>
<td class="flags">Array</td>
<td class="spec">
<code>
<a href="#getElementsByClassName">getElementsByClassName</a>
(&lt;String&gt; className, &lt;String&gt; tag, &lt;String/HTMLElement&gt; root)
</code>
<div class="description">
Returns a array of HTMLElements with the given class.
For <strong>optimized performance</strong>, include a <strong>tag</strong> and/or <strong>root node</strong> when possible.
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getRegion">getRegion</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Returns the region position of the given element.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">String/Array</td>
<td class="spec">
<code>
<a href="#getStyle">getStyle</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; property)
</code>
<div class="description">
Normalizes currentStyle and ComputedStyle.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Int/Array</td>
<td class="spec">
<code>
<a href="#getX">getX</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current X position of the element(s) based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Array</td>
<td class="spec">
<code>
<a href="#getXY">getXY</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current position of the element(s) based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Int/Array</td>
<td class="spec">
<code>
<a href="#getY">getY</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current Y position of the element(s) based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Boolean/Array</td>
<td class="spec">
<code>
<a href="#hasClass">hasClass</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Determines whether the element(s) has the given className&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Boolean/Array</td>
<td class="spec">
<code>
<a href="#inDocument">inDocument</a>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Determines whether the element(s) is present in the current document&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Boolean</td>
<td class="spec">
<code>
<a href="#isAncestor">isAncestor</a>
(haystack, needle)
</code>
<div class="description">
Determines whether an HTMLElement is an ancestor of another HTMLElement in the DOM hierarchy&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#removeClass">removeClass</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Removes a class name from a given element or collection of elements&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#replaceClass">replaceClass</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; oldClassName, &lt;String&gt; newClassName)
</code>
<div class="description">
Replace a class with another class for a given element or collection of elements.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setStyle">setStyle</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; property, &lt;String&gt; val)
</code>
<div class="description">
Wrapper for setting style properties of HTMLElements.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setX">setX</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;Int&gt; x)
</code>
<div class="description">
Set the X position of the element(s) in page coordinates, regardless of how the element is positioned.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setXY">setXY</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;Array&gt; pos, &lt;Boolean&gt; noRetry)
</code>
<div class="description">
Set the position of the element(s) in page coordinates, regardless of how the element is positioned.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setY">setY</a>
(&lt;String/HTMLElement/Array&gt; el, &lt;Int&gt; y)
</code>
<div class="description">
Set the Y position of the element(s) in page coordinates, regardless of how the element is positioned.&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- ========== END METHOD SUMMARY =========== -->
<!-- ============ FIELD DETAIL START =========== -->
<!-- ============ FIELD DETAIL END =========== -->
<!-- ========= CONSTRUCTOR DETAIL START ======== -->
<div class="section constructor details">
<h3><a name="constructorDetails">Constructor Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="YAHOO.util.Dom()">YAHOO.util.Dom</a></h4>
<div class="detail">
<code>
<strong>YAHOO.util.Dom</strong>
()
</code>
<div class="description">
</div>
</div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL END ======== -->
<!-- ============ METHOD DETAIL START ========== -->
<div class="section method details">
<h3><a name="methodDetails">Method Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="addClass">addClass</a></h4>
<div class="detail">
<code>
void
<strong>addClass</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Adds a class name to a given element or collection of elements
<dl>
<dt>Parameters:</dt>
<dd>
<code>className</code> -
the class name to add to the class attribute
</dd>
<dd>
<code>el</code> -
The element or collection of elements to add the class to
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="batch">batch</a></h4>
<div class="detail">
<code>
Object
<strong>batch</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;Function&gt; method, &lt;Any&gt; o, &lt;Boolean&gt; overrideScope)
</code>
<div class="description">
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 ( <strong><code>method(el, o)</code></strong> )
<dl>
<dt>Parameters:</dt>
<dd>
<code>method</code> -
The method to apply to the element(s)
</dd>
<dd>
<code>el</code> - (optional) An element or array of elements to apply the method to
</dd>
<dd>
<code>o</code> -
(optional) An optional arg that is passed to the supplied method
</dd>
<dd>
<code>overrideScope</code> -
(optional) An optional arg that allows the "o" argument to be referred to as "this" within the supplied method
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>The element(s) with the method applied</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="generateId">generateId</a></h4>
<div class="detail">
<code>
Object
<strong>generateId</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; prefix)
</code>
<div class="description">
Generates a unique ID
<dl>
<dt>Parameters:</dt>
<dd>
<code>prefix</code> -
(optional) an optional prefix to use (defaults to "yui-gen")
</dd>
<dd>
<code>el</code> - (optional) An optional element array of elements to add an ID to (no ID is added if one is already present)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>The generated ID, or array of generated IDs (or original ID if already present on an element)</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="get">get</a></h4>
<div class="detail">
<code>
Object
<strong>get</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Returns an HTMLElement reference
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
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.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>A DOM reference to an HTML element or an array of HTMLElements.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getViewportHeight">getViewportHeight</a></h4>
<div class="detail">
<code>
Int
<strong>getViewportHeight</strong>
()
</code>
<div class="description">
Returns the height of the client (viewport).
<dl>
<dt>Returns:</dt>
<dd> The height of the viewable area of the page.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getViewportWidth">getViewportWidth</a></h4>
<div class="detail">
<code>
Int
<strong>getViewportWidth</strong>
()
</code>
<div class="description">
Returns the width of the client (viewport).
<dl>
<dt>Returns:</dt>
<dd> The width of the viewable area of the page.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getElementsBy">getElementsBy</a></h4>
<div class="detail">
<code>
Array
<strong>getElementsBy</strong>
(&lt;Function&gt; method, &lt;String&gt; &lt;String&gt; tag, &lt;String/HTMLElement&gt; root)
</code>
<div class="description">
Returns a array of HTMLElements that pass the test applied by supplied boolean method.
For <strong>optimized performance</strong>, include a <strong>tag</strong> and/or <strong>root node</strong> when possible.
<dl>
<dt>Parameters:</dt>
<dd>
<code>method</code> -
A boolean method to test elements with
</dd>
<dd>
<code>tag</code> -
(optional) The tag name of the elements being collected
</dd>
<dd>
<code>root</code> -
(optional) The HTMLElement or an ID to use as the starting point
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> An array of elements that pass the boolean method test</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getElementsByClassName">getElementsByClassName</a></h4>
<div class="detail">
<code>
Array
<strong>getElementsByClassName</strong>
(&lt;String&gt; className, &lt;String&gt; &lt;String&gt; tag, &lt;String/HTMLElement&gt; root)
</code>
<div class="description">
Returns a array of HTMLElements with the given class
For <strong>optimized performance</strong>, include a <strong>tag</strong> and/or <strong>root node</strong> when possible.
<dl>
<dt>Parameters:</dt>
<dd>
<code>className</code> -
The class name to match against
</dd>
<dd>
<code>tag</code> -
(optional) The tag name of the elements being collected
</dd>
<dd>
<code>root</code> -
(optional) An HTMLElement or an ID to use as the starting point
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> An array of elements that have the given class name</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getRegion">getRegion</a></h4>
<div class="detail">
<code>
Object
<strong>getRegion</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
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).
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>A Region or array of Region instances containing "top, left, bottom, right" member data.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getStyle">getStyle</a></h4>
<div class="detail">
<code>
String/Array
<strong>getStyle</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; property)
</code>
<div class="description">
Normalizes currentStyle and ComputedStyle. <strong>Multiple word properties use camelCase (backgroundColor)</strong>.
<dl>
<dt>Parameters:</dt>
<dd>
<code>property</code> -
The style property whose value is returned.
</dd>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>The current value of the style property for the element(s).</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getX">getX</a></h4>
<div class="detail">
<code>
Int/Array
<strong>getX</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current X position of an element based on page coordinates. <strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>The X position of the element(s)</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getXY">getXY</a></h4>
<div class="detail">
<code>
Array
<strong>getXY</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current position of an element based on page coordinates. <strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getY">getY</a></h4>
<div class="detail">
<code>
Int/Array
<strong>getY</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Gets the current Y position of an element based on page coordinates. <strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>The Y position of the element(s)</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="hasClass">hasClass</a></h4>
<div class="detail">
<code>
Boolean/Array
<strong>hasClass</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Determines whether an HTMLElement has the given className
<dl>
<dt>Parameters:</dt>
<dd>
<code>className</code> -
the class name to search for
</dd>
<dd>
<code>el</code> - The element or collection to test
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>A boolean value or array of boolean values</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="inDocument">inDocument</a></h4>
<div class="detail">
<code>
Boolean
<strong>inDocument</strong>
(&lt;String/HTMLElement/Array&gt; el)
</code>
<div class="description">
Determines whether an HTMLElement is present in the current document
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
The element to search for
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> Whether or not the element is present in the current document</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="isAncestor">isAncestor</a></h4>
<div class="detail">
<code>
Boolean
<strong>isAncestor</strong>
(&lt;String/HTMLElement&gt; haystack, &lt;String/HTMLElement&gt; needle)
</code>
<div class="description">
Determines whether an HTMLElement is an ancestor of another HTML element in the DOM hierarchy
<dl>
<dt>Parameters:</dt>
<dd>
<code>haystack</code> -
The possible ancestor
</dd>
<dd>
<code>needle</code> -
The possible descendent
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> Whether or not the haystack is an ancestor of needle</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="removeClass">removeClass</a></h4>
<div class="detail">
<code>
void
<strong>removeClass</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; className)
</code>
<div class="description">
Removes a class name from a given element or collection of elements
<dl>
<dt>Parameters:</dt>
<dd>
<code>className</code> -
the class name to remove from the class attribute
</dd>
<dd>
<code>el</code> - The element or collection to remove the class from
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="replaceClass">replaceClass</a></h4>
<div class="detail">
<code>
void
<strong>replaceClass</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; oldClassName, &lt;String&gt; newClassName)
</code>
<div class="description">
Replace a class with another class for a given element or collection of elements.
If no oldClassName is present, the newClassName is simply added.
<dl>
<dt>Parameters:</dt>
<dd>
<code>oldClassName</code> -
the class name to be replaced
</dd>
<dd>
<code>newClassName</code> -
the class name that will be replacing the old class name
</dd>
<dd>
<code>el</code> - The element or collection to remove the class from
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setStyle">setStyle</a></h4>
<div class="detail">
<code>
void
<strong>setStyle</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;String&gt; property, &lt;String&gt; val)
</code>
<div class="description">
Wrapper for setting style properties of HTMLElements. Normalizes "opacity" across modern browsers. <strong>Multiple word properties use camelCase (backgroundColor)</strong>.
<dl>
<dt>Parameters:</dt>
<dd>
<code>property</code> -
The style property to be set.
</dd>
<dd>
<code>val</code> -
The value to apply to the given property.
</dd>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setX">setX</a></h4>
<div class="detail">
<code>
void
<strong>setX</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;Int&gt; x)
</code>
<div class="description">
Set the X position of an html element in page coordinates, regardless of how the element is positioned.
<strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>x</code> -
to use as the X coordinate for the element(s).
</dd>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setXY">setXY</a></h4>
<div class="detail">
<code>
void
<strong>setXY</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;Array&gt; pos, &lt;Boolean&gt; noRetry)
</code>
<div class="description">
Set the position of an html element in page coordinates, regardless of how the element is positioned.
<strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>pos</code> -
Contains X & Y values for new position (coordinates are page-based)
</dd>
<dd>
<code>noRetry</code> -
By default we try and set the position a second time if the first fails
</dd>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setY">setY</a></h4>
<div class="detail">
<code>
void
<strong>setY</strong>
(&lt;String/HTMLElement/Array&gt; el, &lt;Int&gt; y)
</code>
<div class="description">
Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
<strong>The element must be part of the DOM tree to have page coordinates</strong> (elements with display = none or not appended to document return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>el</code> -
Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements.
</dd>
<dd>
<code>x</code> -
to use as the Y coordinate for the element(s).
</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
<!-- ============ METHOD DETAIL END ========== -->
</div>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<div id="footer">
<hr />
Copyright &copy; 2006 Yahoo! Inc. All rights reserved.
</div>
</body>
</html>