2791 lines
137 KiB
HTML
2791 lines
137 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>API: event YAHOO.util.Event (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>Event Utility <span class="subtitle">2.5.0</span></h3>
|
|
<p>
|
|
<a href="./index.html">Yahoo! UI Library</a>
|
|
> <a href="./module_event.html">event</a>
|
|
> YAHOO.util.Event
|
|
|
|
</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" /> Show Private</span>
|
|
<span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
|
|
</form>
|
|
|
|
<h2>
|
|
|
|
|
|
<code>static</code>
|
|
|
|
Class <b>YAHOO.util.Event</b>
|
|
<span class="extends">
|
|
</span>
|
|
|
|
<span class="extends">
|
|
</span>
|
|
|
|
</code>
|
|
</h2>
|
|
<!-- class tree goes here -->
|
|
|
|
|
|
|
|
|
|
<div class="summary description">
|
|
The event utility provides functions to add and remove event listeners,
|
|
event cleansing. It also tries to automatically remove listeners it
|
|
registers during the unload event.
|
|
</div>
|
|
|
|
|
|
<div class="section field details">
|
|
<h3 id="properties">Properties</h3>
|
|
<div class="content">
|
|
<div class="private">
|
|
<h4><a name="_dri">_dri</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
document readystate poll handle
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="_interval">_interval</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
poll handle
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="ADJ_SCOPE">ADJ_SCOPE</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Adjusted scope, either the element we are registering the event
|
|
on or the custom object passed in by the listener, int constant
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="counter">counter</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Counter for auto id generation
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="DOMReady">DOMReady</a>
|
|
<code>- static boolean</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
True when the document is initially usable
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="EL">EL</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Element to bind, int constant
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="elCache
|
|
DOM element cache">elCache
|
|
DOM element cache</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated:</strong> Elements are not cached due to issues that arise when
|
|
elements are removed and re-added
|
|
</div>
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="FN">FN</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Function to execute, int constant
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="isIE">isIE</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
IE detection
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated:</strong> use YAHOO.env.ua.ie
|
|
</div>
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="isSafari">isSafari</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Safari detection
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated:</strong> use YAHOO.env.ua.webkit
|
|
</div>
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="lastError">lastError</a>
|
|
<code>- static Error</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
addListener/removeListener can throw errors in unexpected scenarios.
|
|
These errors are suppressed, the method returns false, and this property
|
|
is set
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="legacyEvents">legacyEvents</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Cache of DOM0 event handlers to work around issues with DOM2 events
|
|
in Safari
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="legacyHandlers">legacyHandlers</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Listener stack for DOM0 events
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="legacyMap">legacyMap</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Lookup table for legacy events
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="listeners">listeners</a>
|
|
<code>- private static array</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Cache of wrapped listeners
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="loadComplete">loadComplete</a>
|
|
<code>- private static boolean</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
True after the onload event has fired
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="OBJ">OBJ</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Object passed in by the user that will be returned as a
|
|
parameter to the callback, int constant. Specific to
|
|
unload listeners
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="onAvailStack">onAvailStack</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
onAvailable listeners
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="OVERRIDE">OVERRIDE</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
The original scope parameter passed into addListener
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="POLL_INTERVAL">POLL_INTERVAL</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
The poll interval in milliseconds
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="POLL_RETRYS">POLL_RETRYS</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
The number of times we should look for elements that are not
|
|
in the DOM at the time the event is requested after the document
|
|
has been loaded. The default is 2000@amp;20 ms, so it will poll
|
|
for 40 seconds or until all outstanding handlers are bound
|
|
(whichever comes first).
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="retryCount">retryCount</a>
|
|
<code>- private static object</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
The number of times to poll after window.onload. This number is
|
|
increased if additional late-bound handlers are requested after
|
|
the page load.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="TYPE">TYPE</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Type of event, int constant
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="unloadListeners">unloadListeners</a>
|
|
<code>- private static array</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
User-defined unload function that will be fired before all events
|
|
are detached
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="webkit">webkit</a>
|
|
<code>- private static string</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
webkit version
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated:</strong> use YAHOO.env.ua.webkit
|
|
</div>
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4><a name="webkitKeymap">webkitKeymap</a>
|
|
<code>- private static final {int: int}</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Normalized keycodes for webkit/safari
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4><a name="WFN">WFN</a>
|
|
<code>- static final int</code>
|
|
</h4>
|
|
<div class="detail">
|
|
<div class="description">
|
|
Function wrapped for scope correction and cleanup, int constant
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="section method details">
|
|
<h3 id="methods">Methods</h3>
|
|
<div class="content">
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_getCacheIndex">_getCacheIndex</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_getCacheIndex</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Locating the saved event handler data by function ref
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_getScroll">_getScroll</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_getScroll</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the scrollTop and scrollLeft. Used to calculate the
|
|
pageX and pageY in Internet Explorer
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_getScrollLeft">_getScrollLeft</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_getScrollLeft</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns scrollLeft
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_getScrollTop">_getScrollTop</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_getScrollTop</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns scrollTop
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_isValidCollection">_isValidCollection</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
boolean
|
|
<strong>_isValidCollection</strong>
|
|
(
|
|
|
|
|
|
o
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
We want to be able to use getElementsByTagName as a collection
|
|
to attach a group of events to. Unfortunately, different
|
|
browsers return different types of collections. This function
|
|
tests to determine if the object is array-like. It will also
|
|
fail if the object is an array, but is empty.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>o <object></code>
|
|
the object to test
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
boolean
|
|
</code></dt>
|
|
<dd>true if the object is array-like and populated</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_load">_load</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_load</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
hook up any deferred listeners
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_ready">_ready</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_ready</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Fires the DOMReady event listeners the first time the document is
|
|
usable.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_simpleAdd">_simpleAdd</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_simpleAdd</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
,
|
|
fn
|
|
|
|
|
|
,
|
|
capture
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Adds a DOM event directly without the caching, cleanup, scope adj, etc
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <HTMLElement></code>
|
|
the element to bind the handler to
|
|
</dd>
|
|
<dd>
|
|
<code>sType <string></code>
|
|
the type of event handler
|
|
</dd>
|
|
<dd>
|
|
<code>fn <function></code>
|
|
the callback to invoke
|
|
</dd>
|
|
<dd>
|
|
<code>capture <boolen></code>
|
|
capture or bubble phase
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_simpleRemove">_simpleRemove</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_simpleRemove</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
,
|
|
fn
|
|
|
|
|
|
,
|
|
capture
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Basic remove listener
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <HTMLElement></code>
|
|
the element to bind the handler to
|
|
</dd>
|
|
<dd>
|
|
<code>sType <string></code>
|
|
the type of event handler
|
|
</dd>
|
|
<dd>
|
|
<code>fn <function></code>
|
|
the callback to invoke
|
|
</dd>
|
|
<dd>
|
|
<code>capture <boolen></code>
|
|
capture or bubble phase
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_tryPreloadAttach">_tryPreloadAttach</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_tryPreloadAttach</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Polling function that runs before the onload event fires,
|
|
attempting to attach to DOM Nodes as soon as they are
|
|
available
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="_unload">_unload</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>_unload</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Removes all listeners registered by pe.event. Called
|
|
automatically during the unload event.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="addListener">addListener</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
Boolean
|
|
<strong>addListener</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
,
|
|
fn
|
|
|
|
|
|
,
|
|
obj
|
|
|
|
|
|
,
|
|
override
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Appends an event handler
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <String|HTMLElement|Array|NodeList></code>
|
|
An id, an element
|
|
reference, or a collection of ids and/or elements to assign the
|
|
listener to.
|
|
</dd>
|
|
<dd>
|
|
<code>sType <String></code>
|
|
The type of event to append
|
|
</dd>
|
|
<dd>
|
|
<code>fn <Function></code>
|
|
The method the event invokes
|
|
</dd>
|
|
<dd>
|
|
<code>obj <Object></code>
|
|
An arbitrary object that will be
|
|
passed as a parameter to the handler
|
|
</dd>
|
|
<dd>
|
|
<code>override <Boolean|object></code>
|
|
If true, the obj passed in becomes
|
|
the execution scope of the listener. If an
|
|
object, this object becomes the execution
|
|
scope.
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
Boolean
|
|
</code></dt>
|
|
<dd>True if the action was successful or defered,
|
|
false if one or more of the elements
|
|
could not have the listener attached,
|
|
or if the operation throws an exception.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="clearCache">clearCache</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>clearCache</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Clears the element cache
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated</strong> Elements are not cached any longer
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="fireLegacyEvent">fireLegacyEvent</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>fireLegacyEvent</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
When using legacy events, the handler is routed to this object
|
|
so we can fire our custom listener stack.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="generateId">generateId</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
string
|
|
<strong>generateId</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Generates an unique ID for the element if it does not already
|
|
have one.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <object></code>
|
|
the element to create the id for
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
string
|
|
</code></dt>
|
|
<dd>the resulting id of the element</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getCharCode">getCharCode</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
int
|
|
<strong>getCharCode</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the charcode for an event
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
int
|
|
</code></dt>
|
|
<dd>the event's charCode</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="getEl">getEl</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>getEl</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
We cache elements bound by id because when the unload event
|
|
fires, we can no longer use document.getElementById
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated</strong> Elements are not cached any longer
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getEvent">getEvent</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
Event
|
|
<strong>getEvent</strong>
|
|
(
|
|
|
|
|
|
e
|
|
|
|
|
|
,
|
|
boundEl
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Finds the event in the window object, the caller's arguments, or
|
|
in the arguments of another method in the callstack. This is
|
|
executed automatically for events registered through the event
|
|
manager, so the implementer should not normally need to execute
|
|
this function at all.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>e <Event></code>
|
|
the event parameter from the handler
|
|
</dd>
|
|
<dd>
|
|
<code>boundEl <HTMLElement></code>
|
|
the element the listener is attached to
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
Event
|
|
</code></dt>
|
|
<dd>the event</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="getLegacyIndex">getLegacyIndex</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>getLegacyIndex</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the legacy event index that matches the supplied
|
|
signature
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getListeners">getListeners</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
Object
|
|
<strong>getListeners</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns all listeners attached to the given element via addListener.
|
|
Optionally, you can specify a specific type of event to return.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <HTMLElement|string></code>
|
|
the element or element id to inspect
|
|
</dd>
|
|
<dd>
|
|
<code>sType <string></code>
|
|
optional type of listener to return. If
|
|
left out, all listeners will be returned
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
Object
|
|
</code></dt>
|
|
<dd>the listener. Contains the following fields:
|
|
type: (string) the type of event
|
|
fn: (function) the callback supplied to addListener
|
|
obj: (object) the custom object supplied to addListener
|
|
adjust: (boolean|object) whether or not to adjust the default scope
|
|
scope: (boolean) the derived scope based on the adjust parameter
|
|
index: (int) its position in the Event util listener cache</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getPageX">getPageX</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
int
|
|
<strong>getPageX</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the event's pageX
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
int
|
|
</code></dt>
|
|
<dd>the event's pageX</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getPageY">getPageY</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
int
|
|
<strong>getPageY</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the event's pageY
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
int
|
|
</code></dt>
|
|
<dd>the event's pageY</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getRelatedTarget">getRelatedTarget</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
HTMLElement
|
|
<strong>getRelatedTarget</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the event's related target
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
HTMLElement
|
|
</code></dt>
|
|
<dd>the event's relatedTarget</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getTarget">getTarget</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
HTMLElement
|
|
<strong>getTarget</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
,
|
|
resolveTextNode
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the event's target element. Safari sometimes provides
|
|
a text node, and this is automatically resolved to the text
|
|
node's parent so that it behaves like other browsers.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
<dd>
|
|
<code>resolveTextNode <boolean></code>
|
|
when set to true the target's
|
|
parent will be returned if the target is a
|
|
text node. @deprecated, the text node is
|
|
now resolved automatically
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
HTMLElement
|
|
</code></dt>
|
|
<dd>the event's target</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getTime">getTime</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
Date
|
|
<strong>getTime</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the time of the event. If the time is not included, the
|
|
event is modified using the current time.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
Date
|
|
</code></dt>
|
|
<dd>the time of the event</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="getXY">getXY</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
[x, y]
|
|
<strong>getXY</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Returns the pageX and pageY properties as an indexed array.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
[x, y]
|
|
</code></dt>
|
|
<dd>the pageX and pageY properties of the event</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="on">on</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>on</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
YAHOO.util.Event.on is an alias for addListener
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="onAvailable">onAvailable</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>onAvailable</strong>
|
|
(
|
|
|
|
|
|
p_id
|
|
|
|
|
|
,
|
|
p_fn
|
|
|
|
|
|
,
|
|
p_obj
|
|
|
|
|
|
,
|
|
p_override
|
|
|
|
|
|
,
|
|
checkContent
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Executes the supplied callback when the item with the supplied
|
|
id is found. This is meant to be used to execute behavior as
|
|
soon as possible as the page loads. If you use this after the
|
|
initial page load it will poll for a fixed time for the element.
|
|
The number of times it will poll and the frequency are
|
|
configurable. By default it will poll for 10 seconds.
|
|
<p>The callback is executed with a single parameter:
|
|
the custom object parameter, if provided.</p>
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>p_id <string||string[]></code>
|
|
the id of the element, or an array
|
|
of ids to look for.
|
|
</dd>
|
|
<dd>
|
|
<code>p_fn <function></code>
|
|
what to execute when the element is found.
|
|
</dd>
|
|
<dd>
|
|
<code>p_obj <object></code>
|
|
an optional object to be passed back as
|
|
a parameter to p_fn.
|
|
</dd>
|
|
<dd>
|
|
<code>p_override <boolean|object></code>
|
|
If set to true, p_fn will execute
|
|
in the scope of p_obj, if set to an object it
|
|
will execute in the scope of that object
|
|
</dd>
|
|
<dd>
|
|
<code>checkContent <boolean></code>
|
|
check child node readiness (onContentReady)
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="onContentReady">onContentReady</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>onContentReady</strong>
|
|
(
|
|
|
|
|
|
p_id
|
|
|
|
|
|
,
|
|
p_fn
|
|
|
|
|
|
,
|
|
p_obj
|
|
|
|
|
|
,
|
|
p_override
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Works the same way as onAvailable, but additionally checks the
|
|
state of sibling elements to determine if the content of the
|
|
available element is safe to modify.
|
|
<p>The callback is executed with a single parameter:
|
|
the custom object parameter, if provided.</p>
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>p_id <string></code>
|
|
the id of the element to look for.
|
|
</dd>
|
|
<dd>
|
|
<code>p_fn <function></code>
|
|
what to execute when the element is ready.
|
|
</dd>
|
|
<dd>
|
|
<code>p_obj <object></code>
|
|
an optional object to be passed back as
|
|
a parameter to p_fn.
|
|
</dd>
|
|
<dd>
|
|
<code>p_override <boolean|object></code>
|
|
If set to true, p_fn will execute
|
|
in the scope of p_obj. If an object, p_fn will
|
|
exectute in the scope of that object
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="onDOMReady">onDOMReady</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>onDOMReady</strong>
|
|
(
|
|
|
|
|
|
p_fn
|
|
|
|
|
|
,
|
|
p_obj
|
|
|
|
|
|
,
|
|
p_scope
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Executes the supplied callback when the DOM is first usable. This
|
|
will execute immediately if called after the DOMReady event has
|
|
fired. @todo the DOMContentReady event does not fire when the
|
|
script is dynamically injected into the page. This means the
|
|
DOMReady custom event will never fire in FireFox or Opera when the
|
|
library is injected. It _will_ fire in Safari, and the IE
|
|
implementation would allow for us to fire it if the defered script
|
|
is not available. We want this to behave the same in all browsers.
|
|
Is there a way to identify when the script has been injected
|
|
instead of included inline? Is there a way to know whether the
|
|
window onload event has fired without having had a listener attached
|
|
to it when it did so?
|
|
<p>The callback is a CustomEvent, so the signature is:</p>
|
|
<p>type <string>, args <array>, customobject <object></p>
|
|
<p>For DOMReady events, there are no fire argments, so the
|
|
signature is:</p>
|
|
<p>"DOMReady", [], obj</p>
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>p_fn <function></code>
|
|
what to execute when the element is found.
|
|
</dd>
|
|
<dd>
|
|
<code>p_obj <object></code>
|
|
an optional object to be passed back as
|
|
a parameter to p_fn.
|
|
</dd>
|
|
<dd>
|
|
<code>p_scope <boolean|object></code>
|
|
If set to true, p_fn will execute
|
|
in the scope of p_obj, if set to an object it
|
|
will execute in the scope of that object
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="preventDefault">preventDefault</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>preventDefault</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Prevents the default behavior of the event
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="purgeElement">purgeElement</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>purgeElement</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
recurse
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Removes all listeners attached to the given element via addListener.
|
|
Optionally, the node's children can also be purged.
|
|
Optionally, you can specify a specific type of event to remove.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <HTMLElement></code>
|
|
the element to purge
|
|
</dd>
|
|
<dd>
|
|
<code>recurse <boolean></code>
|
|
recursively purge this element's children
|
|
as well. Use with caution.
|
|
</dd>
|
|
<dd>
|
|
<code>sType <string></code>
|
|
optional type of listener to purge. If
|
|
left out, all listeners will be removed
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="regCE">regCE</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>regCE</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Used by old versions of CustomEvent, restored for backwards
|
|
compatibility
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<div class="deprecated">
|
|
<strong>Deprecated</strong> still here for backwards compatibility
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="removeListener">removeListener</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
boolean
|
|
<strong>removeListener</strong>
|
|
(
|
|
|
|
|
|
el
|
|
|
|
|
|
,
|
|
sType
|
|
|
|
|
|
,
|
|
fn
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Removes an event listener
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>el <String|HTMLElement|Array|NodeList></code>
|
|
An id, an element
|
|
reference, or a collection of ids and/or elements to remove
|
|
the listener from.
|
|
</dd>
|
|
<dd>
|
|
<code>sType <String></code>
|
|
the type of event to remove.
|
|
</dd>
|
|
<dd>
|
|
<code>fn <Function></code>
|
|
the method the event invokes. If fn is
|
|
undefined, then all event handlers for the type of event are
|
|
removed.
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
boolean
|
|
</code></dt>
|
|
<dd>true if the unbind was successful, false
|
|
otherwise.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="resolveTextNode">resolveTextNode</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
HTMLElement
|
|
<strong>resolveTextNode</strong>
|
|
(
|
|
|
|
|
|
node
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
In some cases, some browsers will return a text node inside
|
|
the actual element that was targeted. This normalizes the
|
|
return value for getTarget and getRelatedTarget.
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>node <HTMLElement></code>
|
|
node to resolve
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
HTMLElement
|
|
</code></dt>
|
|
<dd>the normized node</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="startInterval">startInterval</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>startInterval</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="stopEvent">stopEvent</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>stopEvent</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Convenience method for stopPropagation + preventDefault
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="">
|
|
<h4>
|
|
<a name="stopPropagation">stopPropagation</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
static
|
|
|
|
void
|
|
<strong>stopPropagation</strong>
|
|
(
|
|
|
|
|
|
ev
|
|
|
|
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Stops event propagation
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
<dl>
|
|
<dt>Parameters:</dt>
|
|
<dd>
|
|
<code>ev <Event></code>
|
|
the event
|
|
</dd>
|
|
</dl>
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
<div class="private">
|
|
<h4>
|
|
<a name="useLegacyEvent">useLegacyEvent</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
private
|
|
static
|
|
|
|
void
|
|
<strong>useLegacyEvent</strong>
|
|
(
|
|
)
|
|
</code>
|
|
|
|
<div class="description">
|
|
Logic that determines when we should automatically use legacy
|
|
events instead of DOM2 events. Currently this is limited to old
|
|
Safari browsers with a broken preventDefault
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
<dl>
|
|
<dt>Returns:
|
|
<code>
|
|
void
|
|
</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="section method details">
|
|
<h3 id="events">Events</h3>
|
|
<div class="content">
|
|
<div class="">
|
|
<h4>
|
|
<a name="DOMReadyEvent">DOMReadyEvent</a></h4>
|
|
<div class="detail">
|
|
<code>
|
|
|
|
|
|
|
|
<strong>DOMReadyEvent</strong>
|
|
|
|
(
|
|
)
|
|
|
|
</code>
|
|
|
|
<div class="description">
|
|
Custom event the fires when the dom is initially usable
|
|
</div>
|
|
|
|
<div class="description">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<hr />
|
|
</div>
|
|
</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_animation.html">animation</a></li>
|
|
|
|
<li class=""><a href="module_autocomplete.html">autocomplete</a></li>
|
|
|
|
<li class=""><a href="module_button.html">button</a></li>
|
|
|
|
<li class=""><a href="module_calendar.html">calendar</a></li>
|
|
|
|
<li class=""><a href="module_charts.html">charts</a></li>
|
|
|
|
<li class=""><a href="module_colorpicker.html">colorpicker</a></li>
|
|
|
|
<li class=""><a href="module_connection.html">connection</a></li>
|
|
|
|
<li class=""><a href="module_container.html">container</a></li>
|
|
|
|
<li class=""><a href="module_cookie.html">cookie</a></li>
|
|
|
|
<li class=""><a href="module_datasource.html">datasource</a></li>
|
|
|
|
<li class=""><a href="module_datatable.html">datatable</a></li>
|
|
|
|
<li class=""><a href="module_dom.html">dom</a></li>
|
|
|
|
<li class=""><a href="module_dragdrop.html">dragdrop</a></li>
|
|
|
|
<li class=""><a href="module_editor.html">editor</a></li>
|
|
|
|
<li class=""><a href="module_element.html">element</a></li>
|
|
|
|
<li class="selected"><a href="module_event.html">event</a></li>
|
|
|
|
<li class=""><a href="module_get.html">get</a></li>
|
|
|
|
<li class=""><a href="module_history.html">history</a></li>
|
|
|
|
<li class=""><a href="module_imagecropper.html">imagecropper</a></li>
|
|
|
|
<li class=""><a href="module_imageloader.html">imageloader</a></li>
|
|
|
|
<li class=""><a href="module_json.html">json</a></li>
|
|
|
|
<li class=""><a href="module_layout.html">layout</a></li>
|
|
|
|
<li class=""><a href="module_logger.html">logger</a></li>
|
|
|
|
<li class=""><a href="module_menu.html">menu</a></li>
|
|
|
|
<li class=""><a href="module_profiler.html">profiler</a></li>
|
|
|
|
<li class=""><a href="module_profilerviewer.html">profilerviewer</a></li>
|
|
|
|
<li class=""><a href="module_resize.html">resize</a></li>
|
|
|
|
<li class=""><a href="module_selector.html">selector</a></li>
|
|
|
|
<li class=""><a href="module_slider.html">slider</a></li>
|
|
|
|
<li class=""><a href="module_tabview.html">tabview</a></li>
|
|
|
|
<li class=""><a href="module_treeview.html">treeview</a></li>
|
|
|
|
<li class=""><a href="module_uploader.html">uploader</a></li>
|
|
|
|
<li class=""><a href="module_yahoo.html">yahoo</a></li>
|
|
|
|
<li class=""><a href="module_yuiloader.html">yuiloader</a></li>
|
|
|
|
<li class=""><a href="module_yuitest.html">yuitest</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="module">
|
|
<h4>Classes</h4>
|
|
<ul class="content">
|
|
<li class=""><a href="YAHOO.util.CustomEvent.html">YAHOO.util.CustomEvent</a></li>
|
|
<li class="selected"><a href="YAHOO.util.Event.html">YAHOO.util.Event</a></li>
|
|
<li class=""><a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a></li>
|
|
<li class=""><a href="YAHOO.util.KeyListener.html">YAHOO.util.KeyListener</a></li>
|
|
<li class=""><a href="YAHOO.util.Subscriber.html">YAHOO.util.Subscriber</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="module">
|
|
<h4>Files</h4>
|
|
<ul class="content">
|
|
<li class=""><a href="CustomEvent.js.html">CustomEvent.js</a></li>
|
|
<li class=""><a href="Event.js.html">Event.js</a></li>
|
|
<li class=""><a href="EventProvider.js.html">EventProvider.js</a></li>
|
|
<li class=""><a href="KeyListener.js.html">KeyListener.js</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="module">
|
|
<h4>Properties</h4>
|
|
<ul class="content">
|
|
<li class="private"><a href="#_dri">_dri</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#_interval">_interval</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#ADJ_SCOPE">ADJ_SCOPE</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#counter">counter</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#DOMReady">DOMReady</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#EL">EL</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#elCache
|
|
DOM element cache">elCache
|
|
DOM element cache</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#FN">FN</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#isIE">isIE</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#isSafari">isSafari</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#lastError">lastError</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#legacyEvents">legacyEvents</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#legacyHandlers">legacyHandlers</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#legacyMap">legacyMap</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#listeners">listeners</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#loadComplete">loadComplete</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#OBJ">OBJ</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#onAvailStack">onAvailStack</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#OVERRIDE">OVERRIDE</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#POLL_INTERVAL">POLL_INTERVAL</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#POLL_RETRYS">POLL_RETRYS</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#retryCount">retryCount</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#TYPE">TYPE</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#unloadListeners">unloadListeners</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#webkit">webkit</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class="private"><a href="#webkitKeymap">webkitKeymap</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
<li class=""><a href="#WFN">WFN</a>
|
|
<!--<code><int></code>-->
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="module">
|
|
<h4>Methods</h4>
|
|
<ul class="content">
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_getCacheIndex">_getCacheIndex</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_getScroll">_getScroll</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_getScrollLeft">_getScrollLeft</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_getScrollTop">_getScrollTop</a>
|
|
</li>
|
|
<li class="private"><!--<code>boolean</code>-->
|
|
<a href="#_isValidCollection">_isValidCollection</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_load">_load</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_ready">_ready</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_simpleAdd">_simpleAdd</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_simpleRemove">_simpleRemove</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_tryPreloadAttach">_tryPreloadAttach</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#_unload">_unload</a>
|
|
</li>
|
|
<li class=""><!--<code>Boolean</code>-->
|
|
<a href="#addListener">addListener</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#clearCache">clearCache</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#fireLegacyEvent">fireLegacyEvent</a>
|
|
</li>
|
|
<li class=""><!--<code>string</code>-->
|
|
<a href="#generateId">generateId</a>
|
|
</li>
|
|
<li class=""><!--<code>int</code>-->
|
|
<a href="#getCharCode">getCharCode</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#getEl">getEl</a>
|
|
</li>
|
|
<li class=""><!--<code>Event</code>-->
|
|
<a href="#getEvent">getEvent</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#getLegacyIndex">getLegacyIndex</a>
|
|
</li>
|
|
<li class=""><!--<code>Object</code>-->
|
|
<a href="#getListeners">getListeners</a>
|
|
</li>
|
|
<li class=""><!--<code>int</code>-->
|
|
<a href="#getPageX">getPageX</a>
|
|
</li>
|
|
<li class=""><!--<code>int</code>-->
|
|
<a href="#getPageY">getPageY</a>
|
|
</li>
|
|
<li class=""><!--<code>HTMLElement</code>-->
|
|
<a href="#getRelatedTarget">getRelatedTarget</a>
|
|
</li>
|
|
<li class=""><!--<code>HTMLElement</code>-->
|
|
<a href="#getTarget">getTarget</a>
|
|
</li>
|
|
<li class=""><!--<code>Date</code>-->
|
|
<a href="#getTime">getTime</a>
|
|
</li>
|
|
<li class=""><!--<code>[x, y]</code>-->
|
|
<a href="#getXY">getXY</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#on">on</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#onAvailable">onAvailable</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#onContentReady">onContentReady</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#onDOMReady">onDOMReady</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#preventDefault">preventDefault</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#purgeElement">purgeElement</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#regCE">regCE</a>
|
|
</li>
|
|
<li class=""><!--<code>boolean</code>-->
|
|
<a href="#removeListener">removeListener</a>
|
|
</li>
|
|
<li class=""><!--<code>HTMLElement</code>-->
|
|
<a href="#resolveTextNode">resolveTextNode</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#startInterval">startInterval</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#stopEvent">stopEvent</a>
|
|
</li>
|
|
<li class=""><!--<code>void</code>-->
|
|
<a href="#stopPropagation">stopPropagation</a>
|
|
</li>
|
|
<li class="private"><!--<code>void</code>-->
|
|
<a href="#useLegacyEvent">useLegacyEvent</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="module">
|
|
<h4>Events</h4>
|
|
<ul class="content">
|
|
<li class="">
|
|
<a href="#DOMReadyEvent">DOMReadyEvent</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="ft">
|
|
<hr />
|
|
Copyright © 2007 Yahoo! Inc. All rights reserved.
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|