4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-fx-target-Element'>/**
19 </span> * @class Ext.fx.target.Element
20 * @extends Ext.fx.target.Target
22 * This class represents a animation target for an {@link Ext.core.Element}. In general this class will not be
23 * created directly, the {@link Ext.core.Element} will be passed to the animation and
24 * and the appropriate target will be created.
26 Ext.define('Ext.fx.target.Element', {
28 /* Begin Definitions */
30 extend: 'Ext.fx.target.Target',
36 getElVal: function(el, attr, val) {
37 if (val == undefined) {
41 else if (attr === 'y') {
44 else if (attr === 'scrollTop') {
45 val = el.getScroll().top;
47 else if (attr === 'scrollLeft') {
48 val = el.getScroll().left;
50 else if (attr === 'height') {
53 else if (attr === 'width') {
57 val = el.getStyle(attr);
63 getAttr: function(attr, val) {
65 return [[ el, this.getElVal(el, attr, val)]];
68 setAttr: function(targetData) {
69 var target = this.target,
70 ln = targetData.length,
71 attrs, attr, o, i, j, ln2, element, value;
72 for (i = 0; i < ln; i++) {
73 attrs = targetData[i].attrs;
75 if (attrs.hasOwnProperty(attr)) {
76 ln2 = attrs[attr].length;
77 for (j = 0; j < ln2; j++) {
84 else if (attr === 'y') {
87 else if (attr === 'scrollTop') {
88 element.scrollTo('top', value);
90 else if (attr === 'scrollLeft') {
91 element.scrollTo('left',value);
94 element.setStyle(attr, value);