2
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3
Code licensed under the BSD License:
4
http://developer.yahoo.net/yui/license.txt
8
YUI.add('anim-base', function(Y) {
11
* The Animation Utility provides an API for creating advanced transitions.
16
* Provides the base Anim class, for animating numeric properties.
19
* @submodule anim-base
23
* A class for constructing animation instances.
30
var RUNNING = 'running',
31
START_TIME = 'startTime',
32
ELAPSED_TIME = 'elapsedTime',
36
* @description fires when an animation begins.
37
* @param {Event} ev The start event.
44
* @description fires every frame of the animation.
45
* @param {Event} ev The tween event.
52
* @description fires after the animation completes.
53
* @param {Event} ev The end event.
59
REVERSE = 'reverse', // TODO: cleanup
60
ITERATION_COUNT = 'iterationCount',
69
Y.Anim.superclass.constructor.apply(this, arguments);
70
_instances[Y.stamp(this)] = this;
76
* Regex of properties that should use the default unit.
78
* @property RE_DEFAULT_UNIT
81
Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;
84
* The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
86
* @property DEFAULT_UNIT
89
Y.Anim.DEFAULT_UNIT = 'px';
91
Y.Anim.DEFAULT_EASING = function (t, b, c, d) {
92
return c * t / d + b; // linear easing
96
* Bucket for custom getters and setters
103
get: function(anim, attr) {
104
return anim._getOffset(attr);
109
Y.Anim.behaviors.top = Y.Anim.behaviors.left;
112
* The default setter to use when setting object properties.
114
* @property DEFAULT_SETTER
117
Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {
119
anim._node.setStyle(att, fn(elapsed, NUM(from), NUM(to) - NUM(from), duration) + unit);
123
* The default getter to use when getting object properties.
125
* @property DEFAULT_GETTER
128
Y.Anim.DEFAULT_GETTER = function(anim, prop) {
129
return anim._node.getComputedStyle(prop);
134
* The object to be animated.
139
setter: function(node) {
143
Y.log(node + ' is not a valid node', 'warn', 'Anim');
150
* The length of the animation. Defaults to "1" (second).
151
* @attribute duration
159
* The method that will provide values to the attribute(s) during the animation.
160
* Defaults to "Easing.easeNone".
165
value: Y.Anim.DEFAULT_EASING,
167
setter: function(val) {
168
if (typeof val === 'string' && Y.Easing) {
169
return Y.Easing[val];
175
* The starting values for the animated properties.
176
* Fields may be strings, numbers, or functions.
177
* If a function is used, the return value becomes the from value.
178
* If no from value is specified, the DEFAULT_GETTER will be used.
185
* The ending values for the animated properties.
186
* Fields may be strings, numbers, or functions.
193
* Date stamp for the first frame of the animation.
194
* @attribute startTime
205
* Current time the animation has been running.
206
* @attribute elapsedTime
217
* Whether or not the animation is currently running.
225
return !!_running[Y.stamp(this)];
232
* The number of times the animation should run
233
* @attribute iterations
242
* The number of iterations that have occurred.
243
* Resets when an animation ends (reaches iteration count or stop() called).
244
* @attribute iterationCount
255
* How iterations of the animation should behave.
256
* Possible values are "normal" and "alternate".
257
* Normal will repeat the animation, alternate will reverse on every other pass.
259
* @attribute direction
264
value: 'normal' // | alternate (fwd on odd, rev on even per spec)
268
* Whether or not the animation is currently paused.
280
* If true, animation begins from last frame
293
* Runs all animation instances.
297
Y.Anim.run = function() {
298
for (var i in _instances) {
299
if (_instances[i].run) {
306
* Pauses all animation instances.
310
Y.Anim.pause = function() {
311
for (var i in _running) { // stop timer if nothing running
312
if (_running[i].pause) {
320
* Stops all animation instances.
324
Y.Anim.stop = function() {
325
for (var i in _running) { // stop timer if nothing running
326
if (_running[i].stop) {
333
Y.Anim._startTimer = function() {
335
_timer = setInterval(Y.Anim._runFrame, 1);
339
Y.Anim._stopTimer = function() {
340
clearInterval(_timer);
345
* Called per Interval to handle each animation frame.
350
Y.Anim._runFrame = function() {
352
for (var anim in _running) {
353
if (_running[anim]._runFrame) {
355
_running[anim]._runFrame();
364
Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
368
* Starts or resumes an animation.
369
* percent start time marker.
374
if (!this.get(RUNNING)) {
376
} else if (this.get(PAUSED)) {
383
* Pauses the animation and
384
* freezes it in its current state and time.
385
* Calling run() will continue where it left off.
390
if (this.get(RUNNING)) {
397
* Stops the animation and resets its time.
401
stop: function(finish) {
402
if (this.get(RUNNING) || this.get(PAUSED)) {
411
this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
412
this._actualFrames = 0;
413
if (!this.get(PAUSED)) {
414
this._initAnimAttr();
416
_running[Y.stamp(this)] = this;
417
Y.Anim._startTimer();
423
this._set(START_TIME, null);
424
this._set(PAUSED, true);
425
delete _running[Y.stamp(this)];
429
* @description fires when an animation is paused.
430
* @param {Event} ev The pause event.
436
_resume: function() {
437
this._set(PAUSED, false);
438
_running[Y.stamp(this)] = this;
442
* @description fires when an animation is resumed (run from pause).
443
* @param {Event} ev The pause event.
449
_end: function(finish) {
450
this._set(START_TIME, null);
451
this._set(ELAPSED_TIME, 0);
452
this._set(PAUSED, false);
454
delete _running[Y.stamp(this)];
455
this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
458
_runFrame: function() {
459
var attr = this._runtimeAttr,
460
customAttr = Y.Anim.behaviors,
461
easing = attr.easing,
463
t = new Date() - this.get(START_TIME),
464
reversed = this.get(REVERSE),
476
for (var i in attr) {
479
setter = (i in customAttr && 'set' in customAttr[i]) ?
480
customAttr[i].set : Y.Anim.DEFAULT_SETTER;
483
setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
484
} else { // ensure final frame value is set
485
// TODO: handle keyframes
486
setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
491
this._actualFrames += 1;
492
this._set(ELAPSED_TIME, t);
500
_lastFrame: function() {
501
var iter = this.get('iterations'),
502
iterCount = this.get(ITERATION_COUNT);
505
if (iter === 'infinite' || iterCount < iter) {
506
if (this.get('direction') === 'alternate') {
507
this.set(REVERSE, !this.get(REVERSE)); // flip it
511
* @description fires when an animation begins an iteration.
512
* @param {Event} ev The iteration event.
515
this.fire('iteration');
521
this._set(START_TIME, new Date());
522
this._set(ITERATION_COUNT, iterCount);
525
_initAnimAttr: function() {
526
var from = this.get('from') || {},
527
to = this.get('to') || {},
528
dur = this.get('duration') * 1000,
529
node = this.get(NODE),
530
easing = this.get('easing') || {},
532
customAttr = Y.Anim.behaviors,
535
Y.each(to, function(val, name) {
536
if (typeof val === 'function') {
537
val = val.call(this, node);
541
if (begin === undefined) {
542
begin = (name in customAttr && 'get' in customAttr[name]) ?
543
customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
544
} else if (typeof begin === 'function') {
545
begin = begin.call(this, node);
548
var mFrom = Y.Anim.RE_UNITS.exec(begin);
549
var mTo = Y.Anim.RE_UNITS.exec(val);
551
begin = mFrom ? mFrom[1] : begin;
552
end = mTo ? mTo[1] : val;
553
unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
555
if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
556
unit = Y.Anim.DEFAULT_UNIT;
559
if (!begin || !end) {
560
Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');
571
attr.easing = easing;
575
this._runtimeAttr = attr;
579
// TODO: move to computedStyle? (browsers dont agree on default computed offsets)
580
_getOffset: function(attr) {
581
var node = this._node,
582
val = node.getComputedStyle(attr),
583
get = (attr === 'left') ? 'getX': 'getY',
584
set = (attr === 'left') ? 'setX': 'setY';
586
if (val === 'auto') {
587
var position = node.getStyle('position');
588
if (position === 'absolute' || position === 'fixed') {
600
Y.extend(Y.Anim, Y.Base, proto);
603
}, '3.0.0' ,{requires:['base-base', 'node-style']});
604
YUI.add('anim-color', function(Y) {
607
* Adds support for color properties in <code>to</code>
608
* and <code>from</code> attributes.
610
* @submodule anim-color
615
Y.Anim.behaviors.color = {
616
set: function(anim, att, from, to, elapsed, duration, fn) {
617
from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
618
to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
620
if (!from || from.length < 3 || !to || to.length < 3) {
621
Y.error('invalid from or to passed to color behavior');
624
anim._node.setStyle(att, 'rgb(' + [
625
Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
626
Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
627
Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
631
// TODO: default bgcolor const
632
get: function(anim, att) {
633
var val = anim._node.getComputedStyle(att);
634
val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
639
Y.each(['backgroundColor',
646
Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
651
}, '3.0.0' ,{requires:['anim-base']});
652
YUI.add('anim-curve', function(Y) {
655
* Adds support for the <code>curve</code> property for the <code>to</code>
656
* attribute. A curve is zero or more control points and an end point.
658
* @submodule anim-curve
661
Y.Anim.behaviors.curve = {
662
set: function(anim, att, from, to, elapsed, duration, fn) {
663
from = from.slice.call(from);
664
to = to.slice.call(to);
665
var t = fn(elapsed, 0, 100, duration) / 100;
667
anim._node.setXY(Y.Anim.getBezier(to, t));
670
get: function(anim, att) {
671
return anim._node.getXY();
676
* Get the current position of the animated element based on t.
677
* Each point is an array of "x" and "y" values (0 = x, 1 = y)
678
* At least 2 points are required (start and end).
679
* First point is start. Last point is end.
680
* Additional control points are optional.
684
* @param {Array} points An array containing Bezier points
685
* @param {Number} t A number between 0 and 1 which is the basis for determining current position
686
* @return {Array} An array containing int x and y member data
688
Y.Anim.getBezier = function(points, t) {
689
var n = points.length;
692
for (var i = 0; i < n; ++i){
693
tmp[i] = [points[i][0], points[i][1]]; // save input
696
for (var j = 1; j < n; ++j) {
697
for (i = 0; i < n - j; ++i) {
698
tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
699
tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
703
return [ tmp[0][0], tmp[0][1] ];
708
}, '3.0.0' ,{requires:['anim-xy']});
709
YUI.add('anim-easing', function(Y) {
712
TERMS OF USE - EASING EQUATIONS
713
Open source under the BSD License.
714
Copyright 2001 Robert Penner All rights reserved.
716
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
718
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
719
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
720
* Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
722
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
726
* The easing module provides methods for customizing
727
* how an animation behaves during each run.
730
* @submodule anim-easing
736
* Uniform speed between points.
739
* @param {Number} t Time value used to compute current value
740
* @param {Number} b Starting value
741
* @param {Number} c Delta between start and end values
742
* @param {Number} d Total length of animation
743
* @return {Number} The computed value for the current animation frame
745
easeNone: function (t, b, c, d) {
750
* Begins slowly and accelerates towards end. (quadratic)
752
* @param {Number} t Time value used to compute current value
753
* @param {Number} b Starting value
754
* @param {Number} c Delta between start and end values
755
* @param {Number} d Total length of animation
756
* @return {Number} The computed value for the current animation frame
758
easeIn: function (t, b, c, d) {
759
return c*(t/=d)*t + b;
763
* Begins quickly and decelerates towards end. (quadratic)
765
* @param {Number} t Time value used to compute current value
766
* @param {Number} b Starting value
767
* @param {Number} c Delta between start and end values
768
* @param {Number} d Total length of animation
769
* @return {Number} The computed value for the current animation frame
771
easeOut: function (t, b, c, d) {
772
return -c *(t/=d)*(t-2) + b;
776
* Begins slowly and decelerates towards end. (quadratic)
778
* @param {Number} t Time value used to compute current value
779
* @param {Number} b Starting value
780
* @param {Number} c Delta between start and end values
781
* @param {Number} d Total length of animation
782
* @return {Number} The computed value for the current animation frame
784
easeBoth: function (t, b, c, d) {
789
return -c/2 * ((--t)*(t-2) - 1) + b;
793
* Begins slowly and accelerates towards end. (quartic)
794
* @method easeInStrong
795
* @param {Number} t Time value used to compute current value
796
* @param {Number} b Starting value
797
* @param {Number} c Delta between start and end values
798
* @param {Number} d Total length of animation
799
* @return {Number} The computed value for the current animation frame
801
easeInStrong: function (t, b, c, d) {
802
return c*(t/=d)*t*t*t + b;
806
* Begins quickly and decelerates towards end. (quartic)
807
* @method easeOutStrong
808
* @param {Number} t Time value used to compute current value
809
* @param {Number} b Starting value
810
* @param {Number} c Delta between start and end values
811
* @param {Number} d Total length of animation
812
* @return {Number} The computed value for the current animation frame
814
easeOutStrong: function (t, b, c, d) {
815
return -c * ((t=t/d-1)*t*t*t - 1) + b;
819
* Begins slowly and decelerates towards end. (quartic)
820
* @method easeBothStrong
821
* @param {Number} t Time value used to compute current value
822
* @param {Number} b Starting value
823
* @param {Number} c Delta between start and end values
824
* @param {Number} d Total length of animation
825
* @return {Number} The computed value for the current animation frame
827
easeBothStrong: function (t, b, c, d) {
829
return c/2*t*t*t*t + b;
832
return -c/2 * ((t-=2)*t*t*t - 2) + b;
836
* Snap in elastic effect.
838
* @param {Number} t Time value used to compute current value
839
* @param {Number} b Starting value
840
* @param {Number} c Delta between start and end values
841
* @param {Number} d Total length of animation
842
* @param {Number} a Amplitude (optional)
843
* @param {Number} p Period (optional)
844
* @return {Number} The computed value for the current animation frame
847
elasticIn: function (t, b, c, d, a, p) {
852
if ( (t /= d) === 1 ) {
859
if (!a || a < Math.abs(c)) {
864
s = p/(2*Math.PI) * Math.asin (c/a);
867
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
871
* Snap out elastic effect.
873
* @param {Number} t Time value used to compute current value
874
* @param {Number} b Starting value
875
* @param {Number} c Delta between start and end values
876
* @param {Number} d Total length of animation
877
* @param {Number} a Amplitude (optional)
878
* @param {Number} p Period (optional)
879
* @return {Number} The computed value for the current animation frame
881
elasticOut: function (t, b, c, d, a, p) {
886
if ( (t /= d) === 1 ) {
893
if (!a || a < Math.abs(c)) {
898
s = p/(2*Math.PI) * Math.asin (c/a);
901
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
905
* Snap both elastic effect.
906
* @method elasticBoth
907
* @param {Number} t Time value used to compute current value
908
* @param {Number} b Starting value
909
* @param {Number} c Delta between start and end values
910
* @param {Number} d Total length of animation
911
* @param {Number} a Amplitude (optional)
912
* @param {Number} p Period (optional)
913
* @return {Number} The computed value for the current animation frame
915
elasticBoth: function (t, b, c, d, a, p) {
921
if ( (t /= d/2) === 2 ) {
929
if ( !a || a < Math.abs(c) ) {
934
s = p/(2*Math.PI) * Math.asin (c/a);
938
return -0.5*(a*Math.pow(2,10*(t-=1)) *
939
Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
941
return a*Math.pow(2,-10*(t-=1)) *
942
Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
947
* Backtracks slightly, then reverses direction and moves to end.
949
* @param {Number} t Time value used to compute current value
950
* @param {Number} b Starting value
951
* @param {Number} c Delta between start and end values
952
* @param {Number} d Total length of animation
953
* @param {Number} s Overshoot (optional)
954
* @return {Number} The computed value for the current animation frame
956
backIn: function (t, b, c, d, s) {
957
if (s === undefined) {
963
return c*(t/=d)*t*((s+1)*t - s) + b;
967
* Overshoots end, then reverses and comes back to end.
969
* @param {Number} t Time value used to compute current value
970
* @param {Number} b Starting value
971
* @param {Number} c Delta between start and end values
972
* @param {Number} d Total length of animation
973
* @param {Number} s Overshoot (optional)
974
* @return {Number} The computed value for the current animation frame
976
backOut: function (t, b, c, d, s) {
977
if (typeof s === 'undefined') {
980
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
984
* Backtracks slightly, then reverses direction, overshoots end,
985
* then reverses and comes back to end.
987
* @param {Number} t Time value used to compute current value
988
* @param {Number} b Starting value
989
* @param {Number} c Delta between start and end values
990
* @param {Number} d Total length of animation
991
* @param {Number} s Overshoot (optional)
992
* @return {Number} The computed value for the current animation frame
994
backBoth: function (t, b, c, d, s) {
995
if (typeof s === 'undefined') {
999
if ((t /= d/2 ) < 1) {
1000
return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
1002
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
1006
* Bounce off of start.
1008
* @param {Number} t Time value used to compute current value
1009
* @param {Number} b Starting value
1010
* @param {Number} c Delta between start and end values
1011
* @param {Number} d Total length of animation
1012
* @return {Number} The computed value for the current animation frame
1014
bounceIn: function (t, b, c, d) {
1015
return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;
1021
* @param {Number} t Time value used to compute current value
1022
* @param {Number} b Starting value
1023
* @param {Number} c Delta between start and end values
1024
* @param {Number} d Total length of animation
1025
* @return {Number} The computed value for the current animation frame
1027
bounceOut: function (t, b, c, d) {
1028
if ((t/=d) < (1/2.75)) {
1029
return c*(7.5625*t*t) + b;
1030
} else if (t < (2/2.75)) {
1031
return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
1032
} else if (t < (2.5/2.75)) {
1033
return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
1035
return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
1039
* Bounces off start and end.
1040
* @method bounceBoth
1041
* @param {Number} t Time value used to compute current value
1042
* @param {Number} b Starting value
1043
* @param {Number} c Delta between start and end values
1044
* @param {Number} d Total length of animation
1045
* @return {Number} The computed value for the current animation frame
1047
bounceBoth: function (t, b, c, d) {
1049
return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;
1051
return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
1056
}, '3.0.0' ,{requires:['anim-base']});
1057
YUI.add('anim-node-plugin', function(Y) {
1060
* Binds an Anim instance to a Node instance
1062
* @class Plugin.NodeFX
1064
* @submodule anim-node-plugin
1067
var NodeFX = function(config) {
1068
config = (config) ? Y.merge(config) : {};
1069
config.node = config.host;
1070
NodeFX.superclass.constructor.apply(this, arguments);
1073
NodeFX.NAME = "nodefx";
1076
Y.extend(NodeFX, Y.Anim);
1078
Y.namespace('Plugin');
1079
Y.Plugin.NodeFX = NodeFX;
1082
}, '3.0.0' ,{requires:['node-pluginhost', 'anim-base']});
1083
YUI.add('anim-scroll', function(Y) {
1086
* Adds support for the <code>scroll</code> property in <code>to</code>
1087
* and <code>from</code> attributes.
1089
* @submodule anim-scroll
1094
//TODO: deprecate for scrollTop/Left properties?
1095
Y.Anim.behaviors.scroll = {
1096
set: function(anim, att, from, to, elapsed, duration, fn) {
1100
fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
1101
fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
1105
node.set('scrollLeft', val[0]);
1109
node.set('scrollTop', val[1]);
1112
get: function(anim) {
1113
var node = anim._node;
1114
return [node.get('scrollLeft'), node.get('scrollTop')];
1120
}, '3.0.0' ,{requires:['anim-base']});
1121
YUI.add('anim-xy', function(Y) {
1124
* Adds support for the <code>xy</code> property in <code>from</code> and
1125
* <code>to</code> attributes.
1127
* @submodule anim-xy
1132
Y.Anim.behaviors.xy = {
1133
set: function(anim, att, from, to, elapsed, duration, fn) {
1135
fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
1136
fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
1139
get: function(anim) {
1140
return anim._node.getXY();
1146
}, '3.0.0' ,{requires:['anim-base', 'node-screen']});
1149
YUI.add('anim', function(Y){}, '3.0.0' ,{use:['anim-base', 'anim-color', 'anim-curve', 'anim-easing', 'anim-node-plugin', 'anim-scroll', 'anim-xy'], skinnable:false});