node-screen.js.html revision 4fcbec6145d16637205990699912fb90f6a3807c
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>API: node node-screen.js (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/api.css">
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
<h3>node&nbsp; <span class="subtitle">3.00PR1</span></h3>
<p>
<a href="/index.html">Yahoo! UI Library</a>
&gt; <a href="/module_node.html">node</a>
&gt; node-screen.js (source view)
</p>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form name="yui-classopts-form">
<span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> <label for="showprivate">Show Private</label></span>
<span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
<span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
</form>
<div id="srcout">
<style>
#doc3 #classopts { display:none; }
</style>
<div class="highlight" ><pre><span class="c">/**</span>
<span class="c"> * Extended Node interface for managing regions and screen positioning.</span>
<span class="c"> * Adds support for positioning elements and normalizes window size and scroll detection. </span>
<span class="c"> * @module node</span>
<span class="c"> * @submodule node-screen</span>
<span class="c"> * @for Node</span>
<span class="c"> */</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">each</span><span class="o">([</span>
<span class="s1">&#39;winWidth&#39;</span><span class="o">,</span>
<span class="s1">&#39;winHeight&#39;</span><span class="o">,</span>
<span class="s1">&#39;docWidth&#39;</span><span class="o">,</span>
<span class="s1">&#39;docHeight&#39;</span><span class="o">,</span>
<span class="s1">&#39;docScrollX&#39;</span><span class="o">,</span>
<span class="s1">&#39;docScrollY&#39;</span>
<span class="o">],</span>
<span class="k">function</span><span class="o">(</span><span class="nx">v</span><span class="o">,</span> <span class="nx">n</span><span class="o">)</span> <span class="o">{</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">getters</span><span class="o">(</span><span class="nx">v</span><span class="o">,</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">wrapDOMMethod</span><span class="o">(</span><span class="nx">v</span><span class="o">));</span>
<span class="o">}</span>
<span class="o">);</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">addDOMMethods</span><span class="o">([</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getXY</span>
<span class="c"> * @return {Array} The XY position of the node</span>
<span class="c"> */</span>
<span class="s1">&#39;getXY&#39;</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setXY</span>
<span class="c"> * @param {Array} xy Contains X &amp; Y values for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">&#39;setXY&#39;</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getX</span>
<span class="c"> * @return {Int} The X position of the node</span>
<span class="c"> */</span>
<span class="s1">&#39;getX&#39;</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setX</span>
<span class="c"> * @param {Int} x X value for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">&#39;setX&#39;</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getY</span>
<span class="c"> * @return {Int} The Y position of the node</span>
<span class="c"> */</span>
<span class="s1">&#39;getY&#39;</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setY</span>
<span class="c"> * @param {Int} y Y value for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">&#39;setY&#39;</span>
<span class="o">]);</span>
</pre></div>
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_anim.html">anim</a></li>
<li class=""><a href="module_attribute.html">attribute</a></li>
<li class=""><a href="module_base.html">base</a></li>
<li class=""><a href="module_dd.html">dd</a></li>
<li class=""><a href="module_dd-plugin.html">dd-plugin</a></li>
<li class=""><a href="module_dump.html">dump</a></li>
<li class=""><a href="module_event.html">event</a></li>
<li class=""><a href="module_io.html">io</a></li>
<li class="selected"><a href="module_node.html">node</a></li>
<li class=""><a href="module_oop.html">oop</a></li>
<li class=""><a href="module_queue.html">queue</a></li>
<li class=""><a href="module_substitute.html">substitute</a></li>
<li class=""><a href="module_yui.html">yui</a></li>
</ul>
</div>
<div class="module">
<h4>Classes</h4>
<ul class="content">
<li class=""><a href="Node.html">Node</a></li>
<li class=""><a href="NodeList.html">NodeList</a></li>
</ul>
</div>
<div class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="node-class.js.html">node-class.js</a></li>
<li class=""><a href="node-region.js.html">node-region.js</a></li>
<li class="selected"><a href="node-screen.js.html">node-screen.js</a></li>
<li class=""><a href="node-style.js.html">node-style.js</a></li>
<li class=""><a href="node.js.html">node.js</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright &copy; 2008 Yahoo! Inc. All rights reserved.
</div>
</div>
</body>
</html>