31 moderate easing Algorithm To automatically convert the color (# f00 # ff0000 RGB (255, 0, 0) format to the color calculation format, and finally return the # ff0000 format) and PX Unit.
Call interface:
/**
* External interface
* Tween example
* @ Param startprops start attribute, single attribute or Array
* @ Param endprops: End attribute, single attribute or Array
* @ Param timeseconds: the time consumed by the motion, in seconds.
* @ Param animtype: Action type, string type, internal self-conversion Operator
* @ Param delay: the delay time. How long does it take to start motion, in seconds?
*/
Window. rtween = function (startprops, endprops, timeseconds, animtype, delay)
{
VaR Tw = new tween ();
Tw. Start (startprops, endprops, timeseconds, animtype, delay );
Return TW;
}
Example:
Http://img.jb51.net/online/Tween.htm <textarea id="runcode45774"></textarea> Xmlns = "http://www.w3.org/1999/xhtml">
Function alpha2 ()
{
VaR T = rtween (1, 0, 1, type );
T. Run = function (PS)
{
Certificate ('effect'0000.css ('opacity ', PS );
}
T. Complete = function ()
{
Rtween (0, 1, type). Run = function (PS)
{
Certificate ('effect'0000.css ('opacity ', PS );
}
}
}