Mouse moves on font, font color gradient

Source: Internet
Author: User
Tags color representation getcolor

Here the method of communication with the JavaScript in this blog "Mouse move out of the background color gradient" in the same way, I posted the code is all there, we can copy the past directly to see the effect, there are better suggestions of the hope message ...

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Move mouse over font move out font color gradient</title>    <style>        *{margin:0;padding:0;        }ul{margin:10px Auto;padding:20px;width:100px;Background-color:#B7B7B7;font-size:20px;        }ul Li{List-style-type:None;Height:25px;Line-height:25px;text-align:Center;        }a{text-decoration:None;Color:#fff;        }    </style></Head><Body>    <ulID= "Con">        <Li><ahref= "javascript:;">One</a></Li>        <Li><ahref= "javascript:;">Both</a></Li>        <Li><ahref= "javascript:;">Three</a></Li>        <Li><ahref= "javascript:;">Four</a></Li>        <Li><ahref= "javascript:;">Five</a></Li>        <Li><ahref= "javascript:;">Six</a></Li>    </ul>    <Script>        varlinks=document.getElementById ("Con"). getElementsByTagName ("a");  for (varI= 0; I<links.length; I++) {            //The reference here is the same as the one in this blog JavaScript, "Mouse fade out background color change", using the critical valueLinks[i].onmouseover= function() {ChangeColor ( This, the);//This is a very clever way to pass the object to the function, and this is a beautiful} links[i].onmouseout= function() {ChangeColor ( This,0);        }        }; functionChangeColor (obj,color_val) {clearinterval (Obj.timer); varI=Color_val; Obj.timer=SetInterval (function() {Color_val?I--: I++;//This may be the master's writing, color_val equivalent to converting integers to Boolean values when the rule                varresult=GetColor (i); Obj.style.color=result; if(i==0||I== the) {clearinterval (Obj.timer); }            }, -); }        //Convert the color value to 16, referring to a 16 color representation rule, the lighter the color becomes        functionGetColor (color) {varresult= "";  for(varI=0; I<3; I++) {result+=color.tostring ( -); }            return "#"+result; }    </Script></Body></HTML>
mouse moves on font, font color gradient

Mouse moves on font, font color gradient

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.