AAtitit. special effect on changing color over time & #160; --- planning titit of the box management system. With, aatitittitit

Source: Internet
Author: User

AAtitit. special effect on changing color over time --- planning titit of the box management system. With aatitittitit

Atitit. Special Effects on changing colors over time --- plan the box Management System

 

1. Process titrator

The defined parameter color and position (start value, end value, current ratio) "returns a value.

 

 

It can be converted to a dual-bit hexadecimal code after processing

 

Define the composite color, each monochrome value, and then join

 

Callback event, the object to be applied ..

 

 

 

2. required functions

Suspend Function

Added time functions in a unified manner

Unified time reduction

 

Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://blog.csdn.net/attilax

 

3 Overview image:

 

4 --- code

 

Function getCurVal (startVal, endVal, percent)

{

Var rang = Math. abs (startVal-endVal );

Var adjus_count = Math. round (percent * rang );

 

If (startVal> endVal) // reduce

Varcur_val = startVal-adjus_count;

Else // up load

Var cur_val = startVal + adjus_count;

Return cur_val;

}

 

5 --- code22

 

 

Var min_color = 121;

Var max_color = 240;

Var finish_percent = past_time/dura;

Var remain_prercent = remain_time/dura;

// Sec color

Var finishi_color_oct = Math. round (finish_percent * 5 );

Var finishi_color_hex = str_pad (finishi_color_oct.toString (16), 2, "0", STR_PAD_LEFT );

// Fist cloor

Var rang = max_color-min_color;

Var adjus_count = Math. round (remain_prercent * rang );

Var remain_color_ocr = 121 + adjus_count;

Var remain_color_hex = str_pad (remain_color_ocr.toString (16), 2, "0", STR_PAD_LEFT );

// Finishi_color_hex = "00 ";

Var blue_str = "#" + finishi_color_hex + remain_color_hex + "00 ";

 

If (remain_time> 0 ){

((Element).css ("background-image", "none ");

((Element).css ("background-color", blue_str );

}

Zookeeper

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.