JS tween color gradient

Source: Internet
Author: User

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 );
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.