Friday, July 11th, 2008
YPulse: Fades and Pulsations Library
Kent Johnson has released YPulse a simple open source wrapper for the YUI Animation library that makes creating highlight fades and pulsing button glows a bit easier.
You pulse away with something like:
-
-
var pulser = new YAHOO.squarebits.YPulse(
-
‘my-div’,
-
‘backgroundColor’,
-
‘#FFFFFF’, // starting
-
‘#FFFF00′, // ending
-
0.75, // The number of seconds for the start-end transition
-
0.10, // The number of seconds to wait after completing the start-end transition
-
0.75, // The number of seconds for the end-start transition
-
0.75, // The number of seconds to wait after completing the end-start transition
-
YAHOO.util.Easing.easeBoth, // The YAHOO easing method to use for the start-end transition
-
YAHOO.util.Easing.easeBoth // The YAHOO easing method to use for the end-start transition
-
);
-












Cool. But with so many arguments I would prefer YPulse accepting an object as a single parameter. Otherwise it looks like a lot of “magic” numbers to me.