PropertiesMethodsEventsConfig OptionsDirect Link

Class Ext.Element

Defined In: Element_Clean.js
Class: Ext.Element
Extends: Object
Represents an Element in the DOM.

Usage:
呈现DOM里面的一个元素。

用法:

var el = Ext.get("my-div");

// or with getEl
// 或者是 getEl
var el = getEl("my-div");

// or with a DOM element
// 或者是一个 DOM element
var el = Ext.get(myDivElement);
Using Ext.get() or getEl() instead of calling the constructor directly ensures you get the same object each call instead of constructing a new one.

Animations
Many of the functions for manipulating an element have an optional "animate" parameter. The animate parameter should either be a boolean (true) or an object literal with animation options. Note that the supported Element animation options are a subset of the Ext.Fx animation options specific to Fx effects. The Element animation options are: 使用Ext.get或是getEl()来代替调用构造函数,保证每次调用都是获取相同的对象而非构建新的一个。

动画
操作DOM元素,很多情况下会用一些到动画效果(可选的)。 动画选项应该是布尔值(true )或是Object Literal 。动画选项有:
Option    Default   Description
可选项    默认值      描述
--------- --------  ---------------------------------------------
duration  .35       动画持续的时间
easing    easeOut   The easing method
callback  none      当动画完成后执行的函数
scope     this      回调函数的作用欲(可选的)
duration  .35       动画持续的时间(单位:秒)
easing    easeOut   YUI的消除方法
callback  none      动画完成之后执行的函数
scope     this      回调函数的作用域
Also, the Anim object being used for the animation will be set on your options object as "anim", which allows you to stop or manipulate the animation. Here's an example: 另外,可通过配置项中的“anim“来获取动画对象,这样便可停止或操控这个动画效果。例子如下:

var el = Ext.get("my-div");

// no animation
// 没有动画
el.setWidth(100);

// default animation
// 默认动画
el.setWidth(100, true);

// animation with some options set
// 对动画的一些设置
el.setWidth(100, {
    duration: 1,
    callback: this.foo,
    scope: this
});

// using the "anim" property to get the Anim object
// 使用属性“anim”来获取动画对象
var opt = {
    duration: 1,
    callback: this.foo,
    scope: this
};
el.setWidth(100, opt);
...
if(opt.anim.isAnimated()){
    opt.anim.stop();
}
Composite (Collections of) Elements
For working with collections of Elements, see Ext.CompositeElement

配置项

这个类没有配置项。

公告属性

属性 定义者

公共方法

方法 定义者

公告事件

这个类没公共的事件。