Hi Matt,
Thanks for the feedback and test cases.
I took a look, and it appears that the other animation engines tested
use a sinoidal easing as the default. YUI's "easeBoth" is the closest
match to this type of easing.
I hacked together a YUI easing that incorporates the sinoidal algorithm:
YAHOO.util.Easing.custom = function(t, b, c, d) {
t = t / 1000; // convert milliseconds to seconds
return ((-Math.cos(t*Math.PI)/2) + 0.5) * c + b;
};
This keeps the YUI animation in step with the other tests.
The Firebug profiler (with Firefox 3.03) reports that the YUI easing is
called 101 times, vs. 76 and 67 for the others. What method of
profiling are you using?
I am unable to repro the NaN issue with the easing arguments. Would you
mind following up with some more detail on that?
Thanks,
Matt
Matt wrote:
> I have put together a test page, so you can see what I mean:
>
> http://www.mattsnider.com/AnimationSpeedTest.html
>
> If you click "Animate All", you'll see that YUI takes larger steps
> than the other frameworks. Also, it initially starts farther ahead
> than the other frameworks, then swings behind the other animations.
>
> With further analysis, I realized that YUI only calls the easing
> method about 10 times, versus about 40 times with the other
> frameworks. In addition, every other time EaseNone is called, 't' and
> 'c' are 'NaN' instead of numbers, so I assume that YUI animator
> ignores those values.
>
> http://developer.yahoo.com/yui/docs/Easing.js.html
>
> Is there a configurable property to make this animation smoother? I'd
> like to get the same animation effect from YUI that I get with JQuery.
>