ext.element.html.svn-base
来自「PHP 知识管理系统(基于树结构的知识管理系统), 英文原版的PHP源码。」· SVN-BASE 代码 · 共 1,087 行 · 第 1/5 页
SVN-BASE
1,087 行
<div class="body-wrap"> <div class="top-tools"> <a class="inner-link" href="#Ext.Element-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.Element-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.Element-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="bookmark" href="../docs/?class=Ext.Element"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div> <h1>Class Ext.Element</h1> <table cellspacing="0"> <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr> <tr><td class="label">Defined In:</td><td class="hd-info">Element.js</td></tr> <tr><td class="label">Class:</td><td class="hd-info">Element</td></tr> <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.Layer" href="output/Ext.Layer.html">Layer</a></td></tr> <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr> </table> <div class="description"> Represents an Element in the DOM.<br><br>Usage:<br><pre><code><i>// by id</i><b>var</b> el = Ext.get(<em>"my-div"</em>);<i>// by DOM element reference</i><b>var</b> el = Ext.get(myDivElement);</code></pre><b>Animations</b><br />Many of the functions for manipulating an element have an optional "animate" parameter. The animate parametershould either be a boolean (true) or an object literal with animation options. Note that the supported Element animationoptions are a subset of the <a ext:cls="Ext.Fx" href="output/Ext.Fx.html">Ext.Fx</a> animation options specific to Fx effects. The Element animation options are:<pre>Option Default Description--------- -------- ---------------------------------------------duration .35 The duration of the animation in secondseasing easeOut The easing methodcallback none A function to execute when the anim completesscope this The scope (this) of the callback function</pre>Also, the Anim object being used for the animation will be set on your options object as "anim", which allows you to stop ormanipulate the animation. Here's an example:<pre><code>var el = Ext.get(<em>"my-div"</em>);<i>// no animation</i>el.setWidth(100);<i>// <b>default</b> animation</i>el.setWidth(100, true);<i>// animation <b>with</b> some options set</i>el.setWidth(100, { duration: 1, callback: <b>this</b>.foo, scope: <b>this</b>});<i>// using the <em>"anim"</em> property to get the Anim object</i><b>var</b> opt = { duration: 1, callback: <b>this</b>.foo, scope: <b>this</b>};el.setWidth(100, opt);...<b>if</b>(opt.anim.isAnimated()){ opt.anim.stop();}</code></pre><b> Composite (Collections of) Elements</b><br />For working with collections of Elements, see <a ext:cls="Ext.CompositeElement" href="output/Ext.CompositeElement.html">Ext.CompositeElement</a> </div> <div class="hr"></div> <a id="Ext.Element-props"></a> <h2>Public Properties</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2">Property</th> <th class="msource-header">Defined By</th> </tr> <tr class="property-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-Element.DISPLAY"></a>
<b>Element.DISPLAY</b> : Number <div class="mdesc">
<static> Visibility mode constant - Use display to hide element </div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="property-row alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-Element.VISIBILITY"></a>
<b>Element.VISIBILITY</b> : Number <div class="mdesc">
<static> Visibility mode constant - Use visibility to hide element </div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="property-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-defaultUnit"></a>
<b>defaultUnit</b> : String <div class="mdesc">
The default unit to append to CSS values where a unit isn't provided (defaults to px). </div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="property-row alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-dom"></a>
<b>dom</b> : HTMLElement <div class="mdesc">
The DOM element </div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="property-row">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-id"></a>
<b>id</b> : String <div class="mdesc">
The DOM element ID </div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="property-row alt">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-originalDisplay"></a>
<b>originalDisplay</b> : String <div class="mdesc">
The element's default display mode (defaults to "") </div>
</td>
<td class="msource">Element</td>
</tr>
</table> <a id="Ext.Element-methods"></a> <h2>Public Methods</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2">Method</th> <th class="msource-header">Defined By</th> </tr> <tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-Element"></a>
<b>Element</b>( <code>String/HTMLElement element</code>, <span class="optional" title="Optional">[<code>Boolean forceNew</code>]</span> ) <div class="mdesc">
<div class="short">Create a new Element directly.</div>
<div class="long">
Create a new Element directly. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>element</code> : String/HTMLElement<div class="sub-desc"></div></li><li><code>forceNew</code> : Boolean<div class="sub-desc">(optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class).</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code></code></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-Element.fly"></a>
<b>Element.fly</b>( <code>String/HTMLElement el</code>, <span class="optional" title="Optional">[<code>String named</code>]</span> ) : Element <div class="mdesc">
<div class="short"><static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a...</div>
<div class="long">
<static> Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -the dom node can be overwritten by other code. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement<div class="sub-desc">The dom node or id</div></li><li><code>named</code> : String<div class="sub-desc">(optional) Allows for creation of named reusable flyweights toprevent conflicts (e.g. internally Ext uses "_internal")</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Element</code><div class="sub-desc">The shared Element object (or null if no matching element was found)</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="method-row expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-Element.get"></a>
<b>Element.get</b>( <code>Mixed el</code> ) : Element <div class="mdesc">
<div class="short"><static> Static method to retrieve Ext.Element objects.This method does not retrieve Components. This methodr...</div>
<div class="long">
<static> Static method to retrieve Ext.Element objects.<p><b>This method does not retrieve <a ext:cls="Ext.Component" href="output/Ext.Component.html">Component</a>s.</b> This methodretrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component byits ID, use <a ext:cls="Ext.ComponentMgr" ext:member="get" href="output/Ext.ComponentMgr.html#get">Ext.ComponentMgr.get</a>.</p><p>Uses simple caching to consistently return the same object.Automatically fixes if an object was recreated with the same id via AJAX or DOM.</p> <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : Mixed<div class="sub-desc">The id of the node, a DOM Node or an existing Element.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Element</code><div class="sub-desc">The {@link Ext.Element Element} object (or null if no matching element was found)</div></li>
</ul>
</div>
</div>
</div>
</td>
<td class="msource">Element</td>
</tr>
<tr class="method-row alt expandable">
<td class="micon"><a class="exi" href="#expand"> </a></td>
<td class="sig">
<a id="Ext.Element-addClass"></a>
<b>addClass</b>( <code>String/Array className</code> ) : Ext.Element <div class="mdesc">
<div class="short">Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.</div>
<div class="long">
Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>className</code> : String/Array<div class="sub-desc">The CSS class to add, or an array of classes</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Ext.Element</code><div class="sub-desc">this</div></li>
</ul>
</div>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?