Javascript + CSS move the mouse over the text color

Source: Internet
Author: User

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 strict // en"
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> active </title>
<Style type = "text/CSS" Media = "all">
Body {
Font: 85%/140% Arial, Helvetica, sans-serif;
}
Ul {
Padding: 0;
Margin: 10px;
List-style: none;
}
Li {
Color: #333;
Background: # DDD;
Padding: 10px;
Margin-bottom: 2px;
}
Li: hover, Li. sfhover {
Color: red;
Background: # f5f5f5;
}
</Style>
<SCRIPT type = "text/JavaScript"> <! -- // --> <! [CDATA [//> <! --
Function suckerfish (type, Tag, parentid ){
If (window. attachevent ){
Window. attachevent ("onLoad", function (){
VaR sfels = (parentid = NULL )? Document. getelementsbytagname (TAG): Document. getelementbyid (parentid). getelementsbytagname (TAG );
Type (sfels );
});
}
}
Sfhover = function (sfels ){
For (VAR I = 0; I <sfels. length; I ++ ){
Sfels [I]. onmouseover = function (){
This. classname + = "sfhover ";
}
Sfels [I]. onmouseout = function (){
This. classname = This. classname. Replace (New Regexp ("sfhover \ B "),"");
}
}
}
Sfactive = function (sfels ){
For (VAR I = 0; I <sfels. length; I ++ ){
Sfels [I]. onmousedown = function (){
This. classname + = "sfactive ";
}
Sfels [I]. onmouseup = function (){
This. classname = This. classname. Replace (New Regexp ("sfactive \ B "),"");
}
}
}
Suckerfish (sfhover, "Li ");

// --> <!]> </SCRIPT>
</Head>
<Body>
<Ul>
<Li> over the years, browser makers have expanded their support for CSS every time a new version is released. Today, Internet Explorer 6 and Netscape Navigator
7. Mozilla, opera, and Safari all support CSS. However, this does not mean that there is no problem in our career as web designers and developers. Although all the above browsers support
CSS level </LI>
<Li> over the years, browser makers have expanded their support for CSS every time a new version is released. Today, Internet Explorer 6 and Netscape Navigator
7. Mozilla, opera, and Safari all support CSS. However, this does not mean that there is no problem in our career as web designers and developers. Although all the above browsers support
CSS level </LI>
<Li> over the years, browser makers have expanded their support for CSS every time a new version is released. Today, Internet Explorer 6 and Netscape Navigator
7. Mozilla, opera, and Safari all support CSS. However, this does not mean that there is no problem in our career as web designers and developers. Although all the above browsers support
CSS level </LI>
<Li> over the years, browser makers have expanded their support for CSS every time a new version is released. Today, Internet Explorer 6 and Netscape Navigator
7. Mozilla, opera, and Safari all support CSS. However, this does not mean that there is no problem in our career as web designers and developers. Although all the above browsers support
CSS level </LI>
</Ul>

Related Article

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.