webgui/www/extras/yui/docs/animation/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

826 lines
No EOL
19 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>
<!-- ======== 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 ======== -->
<!-- ======== 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">HTMLElement</td>
<td class="spec">
<code>
<a href="#get">get</a>
(el)
</code>
<div class="description">
Returns an HTMLElement reference&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Int</td>
<td class="spec">
<code>
<a href="#getClientHeight">getClientHeight</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="#getClientWidth">getClientWidth</a>
()
</code>
<div class="description">
Returns the width of the client (viewport).&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Region</td>
<td class="spec">
<code>
<a href="#getRegion">getRegion</a>
(el)
</code>
<div class="description">
Returns the region position of the given element.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">String</td>
<td class="spec">
<code>
<a href="#getStyle">getStyle</a>
(el, &lt;String&gt; property)
</code>
<div class="description">
Normalizes currentStyle and ComputedStyle.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getX">getX</a>
(el)
</code>
<div class="description">
Gets the current X position of an element based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getXY">getXY</a>
(el)
</code>
<div class="description">
Gets the current position of an element based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getY">getY</a>
(el)
</code>
<div class="description">
Gets the current Y position of an element based on page coordinates.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setStyle">setStyle</a>
(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">Object</td>
<td class="spec">
<code>
<a href="#setX">setX</a>
(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.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#setXY">setXY</a>
(el, &lt;array&gt; pos, noRetry)
</code>
<div class="description">
Set the position of an html element in page coordinates, regardless of how the element is positioned.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#setY">setY</a>
(el, y)
</code>
<div class="description">
Set the Y position of an html element 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="get">get</a></h4>
<div class="detail">
<code>
HTMLElement
<strong>get</strong>
(el)
</code>
<div class="description">
Returns an HTMLElement reference
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> A DOM reference to an HTML element.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getClientHeight">getClientHeight</a></h4>
<div class="detail">
<code>
Int
<strong>getClientHeight</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="getClientWidth">getClientWidth</a></h4>
<div class="detail">
<code>
Int
<strong>getClientWidth</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="getRegion">getRegion</a></h4>
<div class="detail">
<code>
Region
<strong>getRegion</strong>
(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 (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> A Region instance containing "top, left, bottom, right" member data.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getStyle">getStyle</a></h4>
<div class="detail">
<code>
String
<strong>getStyle</strong>
(el, &lt;String&gt; property)
</code>
<div class="description">
Normalizes currentStyle and ComputedStyle.
<dl>
<dt>Parameters:</dt>
<dd>
<code>property</code> -
The style property whose value is returned.
</dd>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> The current value of the style property.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getX">getX</a></h4>
<div class="detail">
<code>
Object
<strong>getX</strong>
(el)
</code>
<div class="description">
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 (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getXY">getXY</a></h4>
<div class="detail">
<code>
Object
<strong>getXY</strong>
(el)
</code>
<div class="description">
Gets the current position of an element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getY">getY</a></h4>
<div class="detail">
<code>
Object
<strong>getY</strong>
(el)
</code>
<div class="description">
Gets the current Y position of an element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setStyle">setStyle</a></h4>
<div class="detail">
<code>
void
<strong>setStyle</strong>
(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.
<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>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setX">setX</a></h4>
<div class="detail">
<code>
Object
<strong>setX</strong>
(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.
The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>x</code> -
to use as the X coordinate.
</dd>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setXY">setXY</a></h4>
<div class="detail">
<code>
Object
<strong>setXY</strong>
(el, &lt;array&gt; pos, noRetry)
</code>
<div class="description">
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 (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>pos</code> -
Contains X & Y values for new position (coordinates are page-based)
</dd>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="setY">setY</a></h4>
<div class="detail">
<code>
Object
<strong>setY</strong>
(el, y)
</code>
<div class="description">
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 (display:none or elements not appended return false).
<dl>
<dt>Parameters:</dt>
<dd>
<code>String</code> -
| HTMLElement} Accepts either a string to use as an ID for getting a DOM reference, or an actual DOM reference.
</dd>
<dd>
<code>Value</code> -
to use as the Y coordinate.
</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>