1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-fx.target.Element'>/**
2 </span> * @class Ext.fx.target.Element
3 * @extends Ext.fx.target.Target
5 * This class represents a animation target for an {@link Ext.core.Element}. In general this class will not be
6 * created directly, the {@link Ext.core.Element} will be passed to the animation and
7 * and the appropriate target will be created.
9 Ext.define('Ext.fx.target.Element', {
11 /* Begin Definitions */
13 extend: 'Ext.fx.target.Target',
19 getElVal: function(el, attr, val) {
20 if (val == undefined) {
24 else if (attr === 'y') {
27 else if (attr === 'scrollTop') {
28 val = el.getScroll().top;
30 else if (attr === 'scrollLeft') {
31 val = el.getScroll().left;
33 else if (attr === 'height') {
36 else if (attr === 'width') {
40 val = el.getStyle(attr);
46 getAttr: function(attr, val) {
48 return [[ el, this.getElVal(el, attr, val)]];
51 setAttr: function(targetData) {
52 var target = this.target,
53 ln = targetData.length,
54 attrs, attr, o, i, j, ln2, element, value;
55 for (i = 0; i < ln; i++) {
56 attrs = targetData[i].attrs;
58 if (attrs.hasOwnProperty(attr)) {
59 ln2 = attrs[attr].length;
60 for (j = 0; j < ln2; j++) {
67 else if (attr === 'y') {
70 else if (attr === 'scrollTop') {
71 element.scrollTo('top', value);
73 else if (attr === 'scrollLeft') {
74 element.scrollTo('left',value);
77 element.setStyle(attr, value);
85 </pre></pre></body></html>