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) {
149 * The length of the animation. Defaults to "1" (second).
150 * @attribute duration
158 * The method that will provide values to the attribute(s) during the animation.
159 * Defaults to "Easing.easeNone".
164 value: Y.Anim.DEFAULT_EASING,
166 setter: function(val) {
167 if (typeof val === 'string' && Y.Easing) {
168 return Y.Easing[val];
174 * The starting values for the animated properties.
175 * Fields may be strings, numbers, or functions.
176 * If a function is used, the return value becomes the from value.
177 * If no from value is specified, the DEFAULT_GETTER will be used.
184 * The ending values for the animated properties.
185 * Fields may be strings, numbers, or functions.
192 * Date stamp for the first frame of the animation.
193 * @attribute startTime
204 * Current time the animation has been running.
205 * @attribute elapsedTime
216 * Whether or not the animation is currently running.
224 return !!_running[Y.stamp(this)];
231 * The number of times the animation should run
232 * @attribute iterations
241 * The number of iterations that have occurred.
242 * Resets when an animation ends (reaches iteration count or stop() called).
243 * @attribute iterationCount
254 * How iterations of the animation should behave.
255 * Possible values are "normal" and "alternate".
256 * Normal will repeat the animation, alternate will reverse on every other pass.
258 * @attribute direction
263 value: 'normal' // | alternate (fwd on odd, rev on even per spec)
267 * Whether or not the animation is currently paused.
279 * If true, animation begins from last frame
292 * Runs all animation instances.
296 Y.Anim.run = function() {
297 for (var i in _instances) {
298 if (_instances[i].run) {
305 * Pauses all animation instances.
309 Y.Anim.pause = function() {
310 for (var i in _running) { // stop timer if nothing running
311 if (_running[i].pause) {
319 * Stops all animation instances.
323 Y.Anim.stop = function() {
324 for (var i in _running) { // stop timer if nothing running
325 if (_running[i].stop) {
332 Y.Anim._startTimer = function() {
334 _timer = setInterval(Y.Anim._runFrame, 1);
338 Y.Anim._stopTimer = function() {
339 clearInterval(_timer);
344 * Called per Interval to handle each animation frame.
349 Y.Anim._runFrame = function() {
351 for (var anim in _running) {
352 if (_running[anim]._runFrame) {
354 _running[anim]._runFrame();
363 Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;
367 * Starts or resumes an animation.
368 * percent start time marker.
373 if (!this.get(RUNNING)) {
375 } else if (this.get(PAUSED)) {
382 * Pauses the animation and
383 * freezes it in its current state and time.
384 * Calling run() will continue where it left off.
389 if (this.get(RUNNING)) {
396 * Stops the animation and resets its time.
400 stop: function(finish) {
401 if (this.get(RUNNING) || this.get(PAUSED)) {
410 this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));
411 this._actualFrames = 0;
412 if (!this.get(PAUSED)) {
413 this._initAnimAttr();
415 _running[Y.stamp(this)] = this;
416 Y.Anim._startTimer();
422 this._set(START_TIME, null);
423 this._set(PAUSED, true);
424 delete _running[Y.stamp(this)];
428 * @description fires when an animation is paused.
429 * @param {Event} ev The pause event.
435 _resume: function() {
436 this._set(PAUSED, false);
437 _running[Y.stamp(this)] = this;
441 * @description fires when an animation is resumed (run from pause).
442 * @param {Event} ev The pause event.
448 _end: function(finish) {
449 this._set(START_TIME, null);
450 this._set(ELAPSED_TIME, 0);
451 this._set(PAUSED, false);
453 delete _running[Y.stamp(this)];
454 this.fire(END, {elapsed: this.get(ELAPSED_TIME)});
457 _runFrame: function() {
458 var attr = this._runtimeAttr,
459 customAttr = Y.Anim.behaviors,
460 easing = attr.easing,
462 t = new Date() - this.get(START_TIME),
463 reversed = this.get(REVERSE),
475 for (var i in attr) {
478 setter = (i in customAttr && 'set' in customAttr[i]) ?
479 customAttr[i].set : Y.Anim.DEFAULT_SETTER;
482 setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit);
483 } else { // ensure final frame value is set
484 // TODO: handle keyframes
485 setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit);
490 this._actualFrames += 1;
491 this._set(ELAPSED_TIME, t);
499 _lastFrame: function() {
500 var iter = this.get('iterations'),
501 iterCount = this.get(ITERATION_COUNT);
504 if (iter === 'infinite' || iterCount < iter) {
505 if (this.get('direction') === 'alternate') {
506 this.set(REVERSE, !this.get(REVERSE)); // flip it
510 * @description fires when an animation begins an iteration.
511 * @param {Event} ev The iteration event.
514 this.fire('iteration');
520 this._set(START_TIME, new Date());
521 this._set(ITERATION_COUNT, iterCount);
524 _initAnimAttr: function() {
525 var from = this.get('from') || {},
526 to = this.get('to') || {},
527 dur = this.get('duration') * 1000,
528 node = this.get(NODE),
529 easing = this.get('easing') || {},
531 customAttr = Y.Anim.behaviors,
534 Y.each(to, function(val, name) {
535 if (typeof val === 'function') {
536 val = val.call(this, node);
540 if (begin === undefined) {
541 begin = (name in customAttr && 'get' in customAttr[name]) ?
542 customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);
543 } else if (typeof begin === 'function') {
544 begin = begin.call(this, node);
547 var mFrom = Y.Anim.RE_UNITS.exec(begin);
548 var mTo = Y.Anim.RE_UNITS.exec(val);
550 begin = mFrom ? mFrom[1] : begin;
551 end = mTo ? mTo[1] : val;
552 unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units
554 if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {
555 unit = Y.Anim.DEFAULT_UNIT;
558 if (!begin || !end) {
559 Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');
570 attr.easing = easing;
574 this._runtimeAttr = attr;
578 // TODO: move to computedStyle? (browsers dont agree on default computed offsets)
579 _getOffset: function(attr) {
580 var node = this._node,
581 val = node.getComputedStyle(attr),
582 get = (attr === 'left') ? 'getX': 'getY',
583 set = (attr === 'left') ? 'setX': 'setY';
585 if (val === 'auto') {
586 var position = node.getStyle('position');
587 if (position === 'absolute' || position === 'fixed') {
599 Y.extend(Y.Anim, Y.Base, proto);
602 }, '3.0.0' ,{requires:['base-base', 'node-style']});
603 YUI.add('anim-color', function(Y) {
606 * Adds support for color properties in <code>to</code>
607 * and <code>from</code> attributes.
609 * @submodule anim-color
614 Y.Anim.behaviors.color = {
615 set: function(anim, att, from, to, elapsed, duration, fn) {
616 from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));
617 to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));
619 if (!from || from.length < 3 || !to || to.length < 3) {
620 Y.error('invalid from or to passed to color behavior');
623 anim._node.setStyle(att, 'rgb(' + [
624 Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),
625 Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),
626 Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))
630 // TODO: default bgcolor const
631 get: function(anim, att) {
632 var val = anim._node.getComputedStyle(att);
633 val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;
638 Y.each(['backgroundColor',
645 Y.Anim.behaviors[v] = Y.Anim.behaviors.color;
650 }, '3.0.0' ,{requires:['anim-base']});
651 YUI.add('anim-curve', function(Y) {
654 * Adds support for the <code>curve</code> property for the <code>to</code>
655 * attribute. A curve is zero or more control points and an end point.
657 * @submodule anim-curve
660 Y.Anim.behaviors.curve = {
661 set: function(anim, att, from, to, elapsed, duration, fn) {
662 from = from.slice.call(from);
663 to = to.slice.call(to);
664 var t = fn(elapsed, 0, 100, duration) / 100;
666 anim._node.setXY(Y.Anim.getBezier(to, t));
669 get: function(anim, att) {
670 return anim._node.getXY();
675 * Get the current position of the animated element based on t.
676 * Each point is an array of "x" and "y" values (0 = x, 1 = y)
677 * At least 2 points are required (start and end).
678 * First point is start. Last point is end.
679 * Additional control points are optional.
683 * @param {Array} points An array containing Bezier points
684 * @param {Number} t A number between 0 and 1 which is the basis for determining current position
685 * @return {Array} An array containing int x and y member data
687 Y.Anim.getBezier = function(points, t) {
688 var n = points.length;
691 for (var i = 0; i < n; ++i){
692 tmp[i] = [points[i][0], points[i][1]]; // save input
695 for (var j = 1; j < n; ++j) {
696 for (i = 0; i < n - j; ++i) {
697 tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
698 tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
702 return [ tmp[0][0], tmp[0][1] ];
707 }, '3.0.0' ,{requires:['anim-xy']});
708 YUI.add('anim-easing', function(Y) {
711 TERMS OF USE - EASING EQUATIONS
712 Open source under the BSD License.
713 Copyright 2001 Robert Penner All rights reserved.
715 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
717 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
718 * 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.
719 * 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.
721 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.
725 * The easing module provides methods for customizing
726 * how an animation behaves during each run.
729 * @submodule anim-easing
735 * Uniform speed between points.
738 * @param {Number} t Time value used to compute current value
739 * @param {Number} b Starting value
740 * @param {Number} c Delta between start and end values
741 * @param {Number} d Total length of animation
742 * @return {Number} The computed value for the current animation frame
744 easeNone: function (t, b, c, d) {
749 * Begins slowly and accelerates towards end. (quadratic)
751 * @param {Number} t Time value used to compute current value
752 * @param {Number} b Starting value
753 * @param {Number} c Delta between start and end values
754 * @param {Number} d Total length of animation
755 * @return {Number} The computed value for the current animation frame
757 easeIn: function (t, b, c, d) {
758 return c*(t/=d)*t + b;
762 * Begins quickly and decelerates towards end. (quadratic)
764 * @param {Number} t Time value used to compute current value
765 * @param {Number} b Starting value
766 * @param {Number} c Delta between start and end values
767 * @param {Number} d Total length of animation
768 * @return {Number} The computed value for the current animation frame
770 easeOut: function (t, b, c, d) {
771 return -c *(t/=d)*(t-2) + b;
775 * Begins slowly and decelerates towards end. (quadratic)
777 * @param {Number} t Time value used to compute current value
778 * @param {Number} b Starting value
779 * @param {Number} c Delta between start and end values
780 * @param {Number} d Total length of animation
781 * @return {Number} The computed value for the current animation frame
783 easeBoth: function (t, b, c, d) {
788 return -c/2 * ((--t)*(t-2) - 1) + b;
792 * Begins slowly and accelerates towards end. (quartic)
793 * @method easeInStrong
794 * @param {Number} t Time value used to compute current value
795 * @param {Number} b Starting value
796 * @param {Number} c Delta between start and end values
797 * @param {Number} d Total length of animation
798 * @return {Number} The computed value for the current animation frame
800 easeInStrong: function (t, b, c, d) {
801 return c*(t/=d)*t*t*t + b;
805 * Begins quickly and decelerates towards end. (quartic)
806 * @method easeOutStrong
807 * @param {Number} t Time value used to compute current value
808 * @param {Number} b Starting value
809 * @param {Number} c Delta between start and end values
810 * @param {Number} d Total length of animation
811 * @return {Number} The computed value for the current animation frame
813 easeOutStrong: function (t, b, c, d) {
814 return -c * ((t=t/d-1)*t*t*t - 1) + b;
818 * Begins slowly and decelerates towards end. (quartic)
819 * @method easeBothStrong
820 * @param {Number} t Time value used to compute current value
821 * @param {Number} b Starting value
822 * @param {Number} c Delta between start and end values
823 * @param {Number} d Total length of animation
824 * @return {Number} The computed value for the current animation frame
826 easeBothStrong: function (t, b, c, d) {
828 return c/2*t*t*t*t + b;
831 return -c/2 * ((t-=2)*t*t*t - 2) + b;
835 * Snap in elastic effect.
837 * @param {Number} t Time value used to compute current value
838 * @param {Number} b Starting value
839 * @param {Number} c Delta between start and end values
840 * @param {Number} d Total length of animation
841 * @param {Number} a Amplitude (optional)
842 * @param {Number} p Period (optional)
843 * @return {Number} The computed value for the current animation frame
846 elasticIn: function (t, b, c, d, a, p) {
851 if ( (t /= d) === 1 ) {
858 if (!a || a < Math.abs(c)) {
863 s = p/(2*Math.PI) * Math.asin (c/a);
866 return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
870 * Snap out elastic effect.
872 * @param {Number} t Time value used to compute current value
873 * @param {Number} b Starting value
874 * @param {Number} c Delta between start and end values
875 * @param {Number} d Total length of animation
876 * @param {Number} a Amplitude (optional)
877 * @param {Number} p Period (optional)
878 * @return {Number} The computed value for the current animation frame
880 elasticOut: function (t, b, c, d, a, p) {
885 if ( (t /= d) === 1 ) {
892 if (!a || a < Math.abs(c)) {
897 s = p/(2*Math.PI) * Math.asin (c/a);
900 return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
904 * Snap both elastic effect.
905 * @method elasticBoth
906 * @param {Number} t Time value used to compute current value
907 * @param {Number} b Starting value
908 * @param {Number} c Delta between start and end values
909 * @param {Number} d Total length of animation
910 * @param {Number} a Amplitude (optional)
911 * @param {Number} p Period (optional)
912 * @return {Number} The computed value for the current animation frame
914 elasticBoth: function (t, b, c, d, a, p) {
920 if ( (t /= d/2) === 2 ) {
928 if ( !a || a < Math.abs(c) ) {
933 s = p/(2*Math.PI) * Math.asin (c/a);
937 return -0.5*(a*Math.pow(2,10*(t-=1)) *
938 Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
940 return a*Math.pow(2,-10*(t-=1)) *
941 Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;
946 * Backtracks slightly, then reverses direction and moves to end.
948 * @param {Number} t Time value used to compute current value
949 * @param {Number} b Starting value
950 * @param {Number} c Delta between start and end values
951 * @param {Number} d Total length of animation
952 * @param {Number} s Overshoot (optional)
953 * @return {Number} The computed value for the current animation frame
955 backIn: function (t, b, c, d, s) {
956 if (s === undefined) {
962 return c*(t/=d)*t*((s+1)*t - s) + b;
966 * Overshoots end, then reverses and comes back to end.
968 * @param {Number} t Time value used to compute current value
969 * @param {Number} b Starting value
970 * @param {Number} c Delta between start and end values
971 * @param {Number} d Total length of animation
972 * @param {Number} s Overshoot (optional)
973 * @return {Number} The computed value for the current animation frame
975 backOut: function (t, b, c, d, s) {
976 if (typeof s === 'undefined') {
979 return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
983 * Backtracks slightly, then reverses direction, overshoots end,
984 * then reverses and comes back to end.
986 * @param {Number} t Time value used to compute current value
987 * @param {Number} b Starting value
988 * @param {Number} c Delta between start and end values
989 * @param {Number} d Total length of animation
990 * @param {Number} s Overshoot (optional)
991 * @return {Number} The computed value for the current animation frame
993 backBoth: function (t, b, c, d, s) {
994 if (typeof s === 'undefined') {
998 if ((t /= d/2 ) < 1) {
999 return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
1001 return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
1005 * Bounce off of start.
1007 * @param {Number} t Time value used to compute current value
1008 * @param {Number} b Starting value
1009 * @param {Number} c Delta between start and end values
1010 * @param {Number} d Total length of animation
1011 * @return {Number} The computed value for the current animation frame
1013 bounceIn: function (t, b, c, d) {
1014 return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;
1020 * @param {Number} t Time value used to compute current value
1021 * @param {Number} b Starting value
1022 * @param {Number} c Delta between start and end values
1023 * @param {Number} d Total length of animation
1024 * @return {Number} The computed value for the current animation frame
1026 bounceOut: function (t, b, c, d) {
1027 if ((t/=d) < (1/2.75)) {
1028 return c*(7.5625*t*t) + b;
1029 } else if (t < (2/2.75)) {
1030 return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;
1031 } else if (t < (2.5/2.75)) {
1032 return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;
1034 return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;
1038 * Bounces off start and end.
1039 * @method bounceBoth
1040 * @param {Number} t Time value used to compute current value
1041 * @param {Number} b Starting value
1042 * @param {Number} c Delta between start and end values
1043 * @param {Number} d Total length of animation
1044 * @return {Number} The computed value for the current animation frame
1046 bounceBoth: function (t, b, c, d) {
1048 return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;
1050 return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
1055 }, '3.0.0' ,{requires:['anim-base']});
1056 YUI.add('anim-node-plugin', function(Y) {
1059 * Binds an Anim instance to a Node instance
1061 * @class Plugin.NodeFX
1063 * @submodule anim-node-plugin
1066 var NodeFX = function(config) {
1067 config = (config) ? Y.merge(config) : {};
1068 config.node = config.host;
1069 NodeFX.superclass.constructor.apply(this, arguments);
1072 NodeFX.NAME = "nodefx";
1075 Y.extend(NodeFX, Y.Anim);
1077 Y.namespace('Plugin');
1078 Y.Plugin.NodeFX = NodeFX;
1081 }, '3.0.0' ,{requires:['node-pluginhost', 'anim-base']});
1082 YUI.add('anim-scroll', function(Y) {
1085 * Adds support for the <code>scroll</code> property in <code>to</code>
1086 * and <code>from</code> attributes.
1088 * @submodule anim-scroll
1093 //TODO: deprecate for scrollTop/Left properties?
1094 Y.Anim.behaviors.scroll = {
1095 set: function(anim, att, from, to, elapsed, duration, fn) {
1099 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
1100 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
1104 node.set('scrollLeft', val[0]);
1108 node.set('scrollTop', val[1]);
1111 get: function(anim) {
1112 var node = anim._node;
1113 return [node.get('scrollLeft'), node.get('scrollTop')];
1119 }, '3.0.0' ,{requires:['anim-base']});
1120 YUI.add('anim-xy', function(Y) {
1123 * Adds support for the <code>xy</code> property in <code>from</code> and
1124 * <code>to</code> attributes.
1126 * @submodule anim-xy
1131 Y.Anim.behaviors.xy = {
1132 set: function(anim, att, from, to, elapsed, duration, fn) {
1134 fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
1135 fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
1138 get: function(anim) {
1139 return anim._node.getXY();
1145 }, '3.0.0' ,{requires:['anim-base', 'node-screen']});
1148 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});