safeframe
Version:
SafeFrame provides a consistent JS API to include 3rd party content
1,836 lines (1,019 loc) • 48.7 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>$sf.lib.dom | SafeFrames JS API</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="mobileoptimized" content="0" />
<link rel="stylesheet" href="../css/all.css" media="all" />
<link rel="stylesheet" href="../css/handheld.css" media="only screen and (max-width: 660px)" />
<link rel="stylesheet" href="../css/handheld.css" media="handheld" />
<link rel="stylesheet" href="../css/screen.css" media="screen and (min-width: 661px)" />
<script src="../javascript/all.js"></script>
<!--[if lt IE 9]>
<script src="../javascript/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="index">
<div class="menu">
<div class="indexLinks">
</div>
<h2 class="heading1">Classes</h2>
<input type="text" name="classFilter" class="classFilter" id="ClassFilter" placeholder="Filter"></input>
<nav>
<ul class="classList" id="ClassList">
<li><a href="../symbols/%24sf.html">$sf</a></li>
<li><a href="../symbols/%24sf.env.html">$sf<span class='break'> </span>.<span class='break'> </span>env</a></li>
<li><a href="../symbols/%24sf.env.ua.html">$sf<span class='break'> </span>.<span class='break'> </span>env<span class='break'> </span>.<span class='break'> </span>ua</a></li>
<li><a href="../symbols/%24sf.lib.html">$sf<span class='break'> </span>.<span class='break'> </span>lib</a></li>
<li><a href="../symbols/%24sf.lib.dom.html">$sf<span class='break'> </span>.<span class='break'> </span>lib<span class='break'> </span>.<span class='break'> </span>dom</a></li>
<li><a href="../symbols/%24sf.lib.dom.iframes.html">$sf<span class='break'> </span>.<span class='break'> </span>lib<span class='break'> </span>.<span class='break'> </span>dom<span class='break'> </span>.<span class='break'> </span>iframes</a></li>
<li><a href="../symbols/%24sf.lib.dom.msghost.html">$sf<span class='break'> </span>.<span class='break'> </span>lib<span class='break'> </span>.<span class='break'> </span>dom<span class='break'> </span>.<span class='break'> </span>msghost</a></li>
<li><a href="../symbols/%24sf.lib.lang.html">$sf<span class='break'> </span>.<span class='break'> </span>lib<span class='break'> </span>.<span class='break'> </span>lang</a></li>
<li><a href="../symbols/%24sf.lib.lang.ParamHash.html">$sf<span class='break'> </span>.<span class='break'> </span>lib<span class='break'> </span>.<span class='break'> </span>lang<span class='break'> </span>.<span class='break'> </span>ParamHash</a></li>
<li><a href="../symbols/%24sf.pub.html">$sf<span class='break'> </span>.<span class='break'> </span>pub</a></li>
<li><a href="../symbols/%24sf.pub.Config.html">$sf<span class='break'> </span>.<span class='break'> </span>pub<span class='break'> </span>.<span class='break'> </span>Config</a></li>
<li><a href="../symbols/%24sf.pub.PosConfig.html">$sf<span class='break'> </span>.<span class='break'> </span>pub<span class='break'> </span>.<span class='break'> </span>PosConfig</a></li>
<li><a href="../symbols/%24sf.pub.Position.html">$sf<span class='break'> </span>.<span class='break'> </span>pub<span class='break'> </span>.<span class='break'> </span>Position</a></li>
<li><a href="../symbols/%24sf.vend.html">$sf<span class='break'> </span>.<span class='break'> </span>vend</a></li>
</ul>
</nav>
</div>
<div class="fineprint" style="clear:both">
<footer>
Documentation generator: <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0<br />
Template: <a href="" target="_blank">Codeview</a> 1.2.1<br />
Generated on:
<time datetime='2012-7-6' pubdate>2012-7-6 16:05</time>
</footer>
</div>
</div>
<div class="index indexStatic"></div>
<div class="content">
<div class="innerContent">
<article>
<header>
<h1 class="classTitle">
Namespace <span>$sf.lib.dom</span>
</h1>
<div class="intro">
<p class="description summary">
$sf.lib.dom Defines helper functions / objects for common browser web-page / DOM interactions
</p>
<ul class="summary">
</ul>
</div>
</header>
<section>
</section>
<!--
#### METHODS SUMMARY
-->
<section>
<div class="props">
<h2 class="sectionTitle">Method Summary</h2>
<nav>
<table class="summaryTable" id="MethodsList" cellspacing="0" summary="A summary of the methods documented in the class $sf.lib.dom.">
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr
class='item0'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.append">append</a></b>(parNode, child)
</div>
<div class="description">Append and HTMLElement to another HTMLElement</div>
</td>
</tr>
<tr
class='item1'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.attach">attach</a></b>(el, name, cb)
</div>
<div class="description">Attach an event handler to an HTMLElement.</div>
</td>
</tr>
<tr
class='item2'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.attr">attr</a></b>(el, attrName, attrVal)
</div>
<div class="description">Retrieve/Set/Delete an element's attribute.</div>
</td>
</tr>
<tr
class='item3'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.bounds">bounds</a></b>(el, details, check_3D)
</div>
<div class="description">Calculate the surrounding boundaries of an HTMLElement, and whether or not the HTMLElement is "in-view" of the user</div>
</td>
</tr>
<tr
class='item4'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.contains">contains</a></b>(element, needle)
</div>
<div class="description">Returns whether or not an HTMLElement is contained within another HTMLElement</div>
</td>
</tr>
<tr
class='item5'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.css">css</a></b>(el, val)
</div>
<div class="description">Set/Get the CSS text of an HTML element</div>
</td>
</tr>
<tr
class='item6'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.currentStyle">currentStyle</a></b>(el, attr)
</div>
<div class="description">Returns the current value of a style attribute, or the current style object in its entirety depending on whether an attribute parameter is specified</div>
</td>
</tr>
<tr
class='item7'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.detach">detach</a></b>(el, namethe, cb)
</div>
<div class="description">Detach an event handler to an HTMLElement</div>
</td>
</tr>
<tr
class='item8'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.doc">doc</a></b>(el)
</div>
<div class="description">Retrieve a document for a given HTML Element</div>
</td>
</tr>
<tr
class='item9'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.docRect">docRect</a></b>(el)
</div>
<div class="description">Returns an object that represents a rectangle with the geometric information of an HTMLDocument
(includes scroll width / height)</div>
</td>
</tr>
<tr
class='item10'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.elt">elt</a></b>(id, par)
</div>
<div class="description">Retrieve an element by its ID.</div>
</td>
</tr>
<tr
class='item11'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.evtCncl">evtCncl</a></b>(evt)
</div>
<div class="description">Cancel the the default action of a particular DOM event</div>
</td>
</tr>
<tr
class='item12'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.evtTgt">evtTgt</a></b>(evt)
</div>
<div class="description">Return the target/srcElement of an event from an HTML element</div>
</td>
</tr>
<tr
class='item13'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.make">make</a></b>(tagName, parent)
</div>
<div class="description">Make a new element</div>
</td>
</tr>
<tr
class='item14'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.overlaps">overlaps</a></b>(el, limit)
</div>
<div class="description">Find any HTMLElements that are covering a given HTMLElement.</div>
</td>
</tr>
<tr
class='item15'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.par">par</a></b>(el)
</div>
<div class="description">Retrive the parent element of an HTML element</div>
</td>
</tr>
<tr
class='item16'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.purge">purge</a></b>(node)
</div>
<div class="description">A wrapper method for removing elements from a document rather than calling parentNode.removeChild raw.</div>
</td>
</tr>
<tr
class='item17'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.ready">ready</a></b>()
</div>
<div class="description">Returns whether or not the DOM is ready to be manipulated</div>
</td>
</tr>
<tr
class='item18'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.tagName">tagName</a></b>(el)
</div>
<div class="description">A wrapper around retrieving the tagName of an HTML element (normalizes values to lower case strings).</div>
</td>
</tr>
<tr
class='item19'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.tags">tags</a></b>(name, parNode)
</div>
<div class="description">A wrapper around retrieving a list of tags by name.</div>
</td>
</tr>
<tr
class='item20'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.view">view</a></b>(el)
</div>
<div class="description">Retrieve the host window object for a given HTML Element/document.</div>
</td>
</tr>
<tr
class='item21'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.wait">wait</a></b>(cb)
</div>
<div class="description">Fire off a particular function when it is detected that the DOM is ready
Useful when you don't know for sure if the DOM of the browser is ready or not, so this will detect and fire
your function for you.</div>
</td>
</tr>
<tr
class='item22'
>
<td class="attributes"><static> </td>
<td class="nameDescription">
<div class="fixedFont">$sf.lib.dom.<b><a href="../symbols/%24sf.lib.dom.html#.winRect">winRect</a></b>(el)
</div>
<div class="description">Returns an object that represents a rectangle with the geometric information of an HTMLWindow
(does not include scroll width / height)</div>
</td>
</tr>
</tbody>
</table>
</nav>
</div>
</section>
<!--
#### EVENTS SUMMARY
-->
<!--
#### CONSTRUCTOR DETAILS
-->
<!--
#### FIELD DETAILS
-->
<!--
#### METHOD DETAILS
-->
<section>
<div class="details props">
<div class="innerProps">
<h2 class="sectionTitle">
Method Detail
</h2>
<ul class="methodDetail" id="MethodDetail">
<li
class='item0'
>
<div class="fixedFont heading" id=".append">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>append</b>(parNode, child)
</div>
<div class="description">
Append and HTMLElement to another HTMLElement
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>parNode</b>
</dt>
<dd>the HTML element to manipulate</dd>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>child</b>
</dt>
<dd>(Required) the new HTML element to add to the parent
return {HTMLElement|Boolean} the new reference to the child element that was appended, or FALSE if failure</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item1'
>
<div class="fixedFont heading" id=".attach">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>attach</b>(el, name, cb)
</div>
<div class="description">
Attach an event handler to an HTMLElement. Note normalize event names to lower case / w3c standards.
See example.
</div>
<pre class="code">var el = $sf.lib.dom.elt("my_element");
function handle_click(evt)
{
alert('i was clicked');
}
$sf.lib.dom.attach(el,"click",handle_click);</pre>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element to attach an event handler too</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>name</b>
</dt>
<dd>the name of the event to listen too</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>cb</b>
</dt>
<dd>the function used to handle the particular event</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item2'
>
<div class="fixedFont heading" id=".attr">
<span class='lighter'>
<static>
</span>
<span class="light">{String}</span>
<span class="light">$sf.lib.dom.</span><b>attr</b>(el, attrName, attrVal)
</div>
<div class="description">
Retrieve/Set/Delete an element's attribute. Note that this handle's
slight differences in the way HTML attributes are handled across browsers
as well as being shorthand
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element to manipulate</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>attrName</b>
</dt>
<dd>the attribute to set/get</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>attrVal</b>
<i>Optional</i>
</dt>
<dd>, if specified will set the value of the attribute for this element. Passing null will remove the attribute completely</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{String}</span> the value of the attribute normalized to a string (may be empty)</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item3'
>
<div class="fixedFont heading" id=".bounds">
<span class='lighter'>
<static>
</span>
<span class="light">{Object}</span>
<span class="light">$sf.lib.dom.</span><b>bounds</b>(el, details, check_3D)
</div>
<div class="description">
Calculate the surrounding boundaries of an HTMLElement, and whether or not the HTMLElement is "in-view" of the user
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>The element for which to calculate information</dd>
<dt>
<span class="light fixedFont">{Object}</span> <b>details</b>
<i>Optional</i>
</dt>
<dd>An object reference used as an output parameter in which further details about the boundaries of the element are specified</dd>
<dt>
<span class="light fixedFont">{Boolean}</span> <b>check_3D</b>
<i>Optional</i>
</dt>
<dd>Check the element within 3 dimensional space such that any elements covering said element are also take into consideration</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Object}</span> info An object containing information about the element boundaries</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item4'
>
<div class="fixedFont heading" id=".contains">
<span class='lighter'>
<static>
</span>
<span class="light">{Boolean}</span>
<span class="light">$sf.lib.dom.</span><b>contains</b>(element, needle)
</div>
<div class="description">
Returns whether or not an HTMLElement is contained within another HTMLElement
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>element</b>
</dt>
<dd>The HTMLElement reference to search within</dd>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>needle</b>
</dt>
<dd>The HTMLElement for which you want to check if its contained by the 1st parameter</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Boolean}</span> </dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item5'
>
<div class="fixedFont heading" id=".css">
<span class='lighter'>
<static>
</span>
<span class="light">{String}</span>
<span class="light">$sf.lib.dom.</span><b>css</b>(el, val)
</div>
<div class="description">
Set/Get the CSS text of an HTML element
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element to manipulate</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>val</b>
<i>Optional</i>
</dt>
<dd>the CSS string to set if specified (e.g. "background-color:transparent;position:absolute;top:0px;left:0px").</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{String}</span> the value of the attribute normalized to a string (may be empty)</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item6'
>
<div class="fixedFont heading" id=".currentStyle">
<span class='lighter'>
<static>
</span>
<span class="light">{HTMLStyleObject, String}</span>
<span class="light">$sf.lib.dom.</span><b>currentStyle</b>(el, attr)
</div>
<div class="description">
Returns the current value of a style attribute, or the current style object in its entirety depending on whether an attribute parameter is specified
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>The HTMLElement for which to retrieve style information</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>attr</b>
<i>Optional</i>
</dt>
<dd>The style attribute (in JavaScript notation, e.g. 'backgroundColor' rather than 'background-color') to fetch.</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{HTMLStyleObject}</span> An HTMLStyleObject containing all current style attribute values</dd>
<dd><span class="light fixedFont">{String}</span> The value of an style attribute (only if attr parameter is specified).</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item7'
>
<div class="fixedFont heading" id=".detach">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>detach</b>(el, namethe, cb)
</div>
<div class="description">
Detach an event handler to an HTMLElement
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element to attach an event handler too</dd>
<dt>
<span class="light fixedFont">{String}</span> <b>namethe</b>
</dt>
<dd>name of the event to listen too</dd>
<dt>
<span class="light fixedFont">{Function}</span> <b>cb</b>
</dt>
<dd>the function used to handle the particular event</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item8'
>
<div class="fixedFont heading" id=".doc">
<span class='lighter'>
<static>
</span>
<span class="light">{Document|null}</span>
<span class="light">$sf.lib.dom.</span><b>doc</b>(el)
</div>
<div class="description">
Retrieve a document for a given HTML Element
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element for which you wish to find it's parent document</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Document|null}</span> null if nothing found</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item9'
>
<div class="fixedFont heading" id=".docRect">
<span class='lighter'>
<static>
</span>
<span class="light">{Object}</span>
<span class="light">$sf.lib.dom.</span><b>docRect</b>(el)
</div>
<div class="description">
Returns an object that represents a rectangle with the geometric information of an HTMLDocument
(includes scroll width / height)
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
<i>Optional</i>
</dt>
<dd>An HTMLElement to use as the reference for an HTMLDocument</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Object}</span> </dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item10'
>
<div class="fixedFont heading" id=".elt">
<span class='lighter'>
<static>
</span>
<span class="light">{HTMLElement|null}</span>
<span class="light">$sf.lib.dom.</span><b>elt</b>(id, par)
</div>
<div class="description">
Retrieve an element by its ID. . basically a short hand wrapper around document.getElementById.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>id</b>
</dt>
<dd>(Required) the id of the HTML element to find</dd>
<dt>
<span class="light fixedFont">{HTMLElement|HTMLWindow|HTMLDocument}</span> <b>par</b>
<i>Optional</i>
</dt>
<dd>The parent element,document,window to look for the given element</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{HTMLElement|null}</span> null if nothing found</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item11'
>
<div class="fixedFont heading" id=".evtCncl">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>evtCncl</b>(evt)
</div>
<div class="description">
Cancel the the default action of a particular DOM event
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLEvent}</span> <b>evt</b>
</dt>
<dd>The raw HTML event</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item12'
>
<div class="fixedFont heading" id=".evtTgt">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>evtTgt</b>(evt)
</div>
<div class="description">
Return the target/srcElement of an event from an HTML element
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLEvent}</span> <b>evt</b>
</dt>
<dd>The raw HTML event</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item13'
>
<div class="fixedFont heading" id=".make">
<span class='lighter'>
<static>
</span>
<span class="light">{HTMLElement}</span>
<span class="light">$sf.lib.dom.</span><b>make</b>(tagName, parent)
</div>
<div class="description">
Make a new element
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>tagName</b>
</dt>
<dd></dd>
<dt>
<span class="light fixedFont">{Document|HTMLElement|Window}</span> <b>parent</b>
<i>Optional</i>
</dt>
<dd>element, document, or window to make the tag in, optional.</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{HTMLElement}</span> </dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item14'
>
<div class="fixedFont heading" id=".overlaps">
<span class='lighter'>
<static>
</span>
<span class="light">{Array}</span>
<span class="light">$sf.lib.dom.</span><b>overlaps</b>(el, limit)
</div>
<div class="description">
Find any HTMLElements that are covering a given HTMLElement.
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>The HTMLElement for which to find any other elements that may be covering it.</dd>
<dt>
<span class="light fixedFont">{Number}</span> <b>limit</b>
<i>Optional</i>
</dt>
<dd>The maximum number of covering elements to return</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Array}</span> An array of elements that are covering the given element</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item15'
>
<div class="fixedFont heading" id=".par">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>par</b>(el)
</div>
<div class="description">
Retrive the parent element of an HTML element
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>the HTML element to check
return {HTMLElement} the new reference to the parent element or null</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item16'
>
<div class="fixedFont heading" id=".purge">
<span class='lighter'>
<static>
</span>
<span class="light">{Boolean}</span>
<span class="light">$sf.lib.dom.</span><b>purge</b>(node)
</div>
<div class="description">
A wrapper method for removing elements from a document rather than calling parentNode.removeChild raw.
Has special processing to ensure that contents of IFRAME tags gets released from memory as well
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>node</b>
</dt>
<dd>The HTML element to be removed from the dom</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Boolean}</span> Whether or not the element was successfully removed</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item17'
>
<div class="fixedFont heading" id=".ready">
<span class='lighter'>
<static>
</span>
<span class="light">{Boolean}</span>
<span class="light">$sf.lib.dom.</span><b>ready</b>()
</div>
<div class="description">
Returns whether or not the DOM is ready to be manipulated
</div>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Boolean}</span> </dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item18'
>
<div class="fixedFont heading" id=".tagName">
<span class='lighter'>
<static>
</span>
<span class="light">{String}</span>
<span class="light">$sf.lib.dom.</span><b>tagName</b>(el)
</div>
<div class="description">
A wrapper around retrieving the tagName of an HTML element (normalizes values to lower case strings).
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
</dt>
<dd>The HTML element for which to get the tag name.</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{String}</span> The tag name in all lower case of an HTML element, if it cannot be successfully retrieved, alwasys returns an empty string (which will evaluate to FALSE).</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item19'
>
<div class="fixedFont heading" id=".tags">
<span class='lighter'>
<static>
</span>
<span class="light">{HTMLElementCollection}</span>
<span class="light">$sf.lib.dom.</span><b>tags</b>(name, parNode)
</div>
<div class="description">
A wrapper around retrieving a list of tags by name.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{String}</span> <b>name</b>
</dt>
<dd>The name of the tags that you wish to look for, note that you can pass in "*" to find all.</dd>
<dt>
<span class="light fixedFont">{HTMLElement|Document}</span> <b>parNode</b>
<i>Optional</i>
</dt>
<dd>the parent node that you wish to look in</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{HTMLElementCollection}</span> List of tags found. Note that is NOT a real JavaScript Array</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item20'
>
<div class="fixedFont heading" id=".view">
<span class='lighter'>
<static>
</span>
<span class="light">{Document|null}</span>
<span class="light">$sf.lib.dom.</span><b>view</b>(el)
</div>
<div class="description">
Retrieve the host window object for a given HTML Element/document. Note that this is NOT the same as $sf.lib.dom.iframes.view, which
returns the window reference INSIDE the IFRAME element.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement|HTMLDocument}</span> <b>el</b>
</dt>
<dd>the HTML element/document for which you wish to find it's parent window</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Document|null}</span> null if nothing found</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item21'
>
<div class="fixedFont heading" id=".wait">
<span class='lighter'>
<static>
</span>
<span class="light">$sf.lib.dom.</span><b>wait</b>(cb)
</div>
<div class="description">
Fire off a particular function when it is detected that the DOM is ready
Useful when you don't know for sure if the DOM of the browser is ready or not, so this will detect and fire
your function for you.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{Function}</span> <b>cb</b>
</dt>
<dd>A function reference to be called when the DOM is ready</dd>
</dl>
<div class="hr"></div>
</li>
<li
class='item22'
>
<div class="fixedFont heading" id=".winRect">
<span class='lighter'>
<static>
</span>
<span class="light">{Object}</span>
<span class="light">$sf.lib.dom.</span><b>winRect</b>(el)
</div>
<div class="description">
Returns an object that represents a rectangle with the geometric information of an HTMLWindow
(does not include scroll width / height)
<br />
<i>Defined in: </i> <C:\DEV\Projects\Yahoo\IAB-SafeFrames\trunk\src\js\pub\pub.js>.
</div>
<dl class="detailList params">
<dt class="heading">Parameters:</dt>
<dt>
<span class="light fixedFont">{HTMLElement}</span> <b>el</b>
<i>Optional</i>
</dt>
<dd>An HTMLElement to use as the references for an HTMLWindow</dd>
</dl>
<dl class="detailList nomargin">
<dt class="heading">Returns:</dt>
<dd><span class="light fixedFont">{Object}</span> </dd>
</dl>
</li>
</ul>
</div>
</div>
</section>
<!--
#### EVENT DETAILS
-->
</article>
</div>
</div>
<script type="text/javascript">
wbos.CssTools.MediaQueryFallBack.LoadCss('../css/screen.css', '../css/handheld.css', 660)
codeview.classFilter.Init()
</script>
</body>
</html>