Fading Effect with YUI’s Animation Utility
In YUI's Animation Utility example page there are demonstrations on how to create color and motion animations. However I couldn't find an example for how to create fading effect. After spending some time on trying different approaches, I came up with this code snip:
var aniObj = new YAHOO.util.Anim(
'DOM reference or ID' ,
{ opacity: {from: 0, to: 1 } },
'duration in second',
'easing'
);
where easing can be one of the following:
YAHOO.util.Easing.backBoth YAHOO.util.Easing.backIn YAHOO.util.Easing.backOut YAHOO.util.Easing.bounceBoth YAHOO.util.Easing.bounceIn YAHOO.util.Easing.bounceOut YAHOO.util.Easing.easeBoth YAHOO.util.Easing.easeBothStrong YAHOO.util.Easing.easeIn YAHOO.util.Easing.easeInStrong YAHOO.util.Easing.easeNone YAHOO.util.Easing.easeOut YAHOO.util.Easing.easeOutStrong YAHOO.util.Easing.elasticBoth YAHOO.util.Easing.elasticIn YAHOO.util.Easing.elasticOut
If you find this post useful, consider donating a few bucks to help the server running cost.
More interesting posts ...
Subscribe to keep track of your comment.
9 Comments so far

http://developer.yahoo.com/yui/examples/container/panelphotobox/1.html
incorporated connote slackly triviality:...