The image is shown above .. Download the image .. Good results .. JS directly connects to the remote connection.
CodePoor reusability .. I hope you can give me some advice.
Copy code The Code is as follows: <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> test navigation </title>
<SCRIPT src = "http://img.jb51.net/jslib/jquery/jquery.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
$ (Document). Ready (function ()
{
VaR datacss = ["home", "game", "Zine", "Community", "calendar", "participant"];
For (VAR I = 0; I <datacss. length; I ++)
{
$ ("#" + Datacss [I]). append ("<Div class = '" + datacss [I] + "'> </div> ");
$ ("." +Datacss[i00000000.css ('opacity ', 0 );
$ ("#" + Datacss [I]). Hover (
Function ()
{
$ ("." + This. ID). Stop (). animate ({opacity: '1'}, 800 );
},
Function ()
{
$ ("." + This. ID). Stop (). animate ({opacity: '0'}, 800 );
});
}
});
</SCRIPT>
<Style type = "text/CSS">
Body {} ul Li {list-style: none; float: Left; margin: 0; padding: 0 ;}
# Home {Background: url(navigation.jpg) top left no-Repeat;
Width: 90px; Height: 55px;
}
. Home {Background: url(navigation.jpg) 0-55px no-Repeat;
Width: 90px; Height: 55px;
}
# Game {Background: url(navigation.jpg)-90px 0px; no-Repeat;
Width: 114px; Height: 55px;
}
. Game {Background: url(navigation.jpg)-90px-55px no-Repeat;
Width: 114px; Height: 55px;
}
# Zine {Background: url(navigation.jpg)-204px 0px; no-Repeat;
Width: 96px; Height: 55px;
}
. Zine {Background: url(navigation.jpg)-204px-55px no-Repeat;
Width: 96px; Height: 55px;
}
# Community {Background: url(navigation.jpg)-300px 0px; no-Repeat;
Width: 144px; Height: 55px;
}
. Community {Background: url(navigation.jpg)-300px-55px no-Repeat;
Width: 144px; Height: 55px;
}
# Calendar {Background: url(navigation.jpg)-446px 0px; no-Repeat;
Width: 137px; Height: 55px;
}
. Calendar {Background: url(navigation.jpg)-446px-55px no-Repeat;
Width: 137px; Height: 55px;
}
# Participant {Background: url(navigation.jpg)-583px 0px; no-Repeat;
Width: 135px; Height: 55px;
}
. Participating {Background: url(navigation.jpg)-583px-55px no-Repeat;
Width: 135px; Height: 55px;
}
</Style>
</Head>
<Body>
<Ul>
<Li> <a href = "#"> <Div id = "home"> </div> </a> </LI>
<Li> <a href = "#"> <Div id = "game"> </div> </a> </LI>
<Li> <a href = "#"> <Div id = "Zine"> </div> </a> </LI>
<Li> <a href = "#"> <Div id = "Community"> </div> </a> </LI>
<Li> <a href = "#"> <Div id = "calendar"> </div> </a> </LI>
<Li> <a href = "#"> <Div id = "participant"> </div> </a> </LI>
</Ul>
</Body>
</Html>