First look
The implementation is similar.
The following code is all uploaded: (there are a few images. You can download my project from my csdn .)
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "tag effect. aspx. cs" inherits = "WSW _ test_tag effect" %>
<! 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 runat = "server">
<Title> No title page </title>
<Style media = "screen" type = "text/CSS">
*{
Font-size: 12px;
}
HTML, body {
Margin: 0;
Text-align: center;
Over-flow: hidden;
Height: 100%;
Width: 100%;
}
Ul {
List-style-type: none;
Margin: 0px;
}
/* Standard box model */
. TTL {
Height: 18px;
}
. CTT {
Height: auto;
Padding: 6px;
Clear: both;
Border: 1px solid #064ca1;
Border-top: 0;
Text-align: left;
}
. W936 {
Margin: 2px 0;
Clear: both;
Width: 936px;/* width of the sliding door */
}
/* Tab switching effect */
. Tb _{
Background-image: url('tabs2_1.gif ');
Background-repeat: Repeat-X;
Background-color: # e6f2ff;
}
. Tb _ ul {
Height: 24px;
}
. Tb _ Li {
Float: left;
Height: 24px;
Line-Height: 1.9;
Width: 94px;
Cursor: pointer;
}
/* Control the display and hide CSS Classes */
. Normaltab {
Background-image: url('tabs2_2.gif ');
Background-repeat: No-Repeat;
Color: #1f3a87;
}
. Hovertab {
Background-image: url('tabs2_3.gif ');
Background-repeat: No-Repeat;
Color: #1f3a87;
Font-weight: bold
}
. Dis {
Display: block;
}
. Undis {
Display: none;
}
</Style>
<SCRIPT type = "text/JavaScript" Language = "JavaScript">
// <! CDATA [
Function g (o) {return document. getelementbyid (o );}
Function hoverli (n ){
// If there are n tags, I <= N;
For (VAR I = 1; I <= 6; I ++) {G ('tb _ '+ I ). classname = 'normaltab'; G ('tbc _ 0' + I ). classname = 'undis ';} g ('tbc _ 0' + n ). classname = 'dis '; G ('tb _' + n ). classname = 'hovertab ';
}
// Change onmouseover in <li> to onclick if you want to make a click;
//]>
</SCRIPT>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div class = "w936">
<Div id = "Tb _" class = "Tb _">
<Ul>
<Li id = "tb_1" class = "hovertab" onmouseover = "X: hoverli (1);"> ASP. NET </LI>
<Li id = "tb_2" class = "normaltab" onmouseover = "I: hoverli (2);"> mysql </LI>
<Li id = "tb_3" class = "normaltab" onmouseover = "A: hoverli (3);"> Delphi </LI>
<Li id = "tb_4" class = "normaltab" onmouseover = "O: hoverli (4);"> VB. NET </LI>
<Li id = "tb_5" class = "normaltab" onmouseover = "G: hoverli (5);"> JAVA </LI>
<Li id = "tb_6" class = "normaltab" onmouseover = "Z: hoverli (6);"> PhP5 </LI>
</Ul>
</Div>
<Div class = "CTT">
<Div class = "dis" id = "tbc_01"> ASP. NET content </div>
<Div class = "Undis" id = "tbc_02"> mysql-related content </div>
<Div class = "Undis" id = "tbc_03"> here is the related content of Delphi </div>
<Div class = "Undis" id = "tbc_04"> here is the content related to VB. NET. </div>
<Div class = "Undis" id = "tbc_05"> JAVA content </div>
<Div class = "Undis" id = "tbc_06"> here is the related content of PhP5 </div>
</Div>
</Div>
</Form>
</Body>
</Html>
Function above: Download csdn... Http://download.csdn.net/detail/njxiaogui/4165885