I am doing a secondary navigation and implementing the ad bar click-close function. The Code is as follows. Copy it to preview the 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>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style type = "text/css">
<! --
. L1 {
Width: 151px;
Height: 36px;
Float: left;
Background-color: # FF0000;
Color: #000000;
List-style-type: none;
Margin: 0px;
Padding: 0px;
}
. A2 {
Font-size: 12px;
Text-align: center;
Display: block;
Width: 150px;
Height: 35px;
Line-height: 35px;
Border-top-width: 1px;
Border-right-width: 1px;
Border-bottom-width: 1px;
Border-left-width: 1px;
Border-top-style: solid;
Border-right-style: solid;
Border-bottom-style: solid;
Border-left-style: solid;
Border-top-color: # CC3300;
Border-right-color: # CC3300;
Border-bottom-color: # CC3300;
Border-left-color: # CC3300;
}
A: link {
Color: #000000;
Text-decoration: none;
}
A: visited {
Color: #000000;
Text-decoration: none;
}
A: hover {
Color: # FFFFFF;
Text-decoration: none;
}
A: active {
Color: # FFFFFF;
Text-decoration: none;
}
# Shang {
Width: 604px;
Margin: 0 auto ;}
Span {
Width: 488px;
Color: # F00;
Background-color: # F00;
Position: absolute;
Top: 38px;
Padding: 0px;
Margin: 0px;
Display: none;
Margin-left: 10px;
}
. A1 {
Width: 120px;
Height: 25px;
Float: left;
Display: block;
Line-height: 25px;
Margin: 0px;
Color: #000;
Font-size: 12px;
Text-align: center;
Border: 1px solid # CC3300;
}
. Zhuti {
Width: 605px;
Margin: auto;
}
. Yejiao {
Position: absolute;
Top: 46px;
Width: 32px;
Height: 15px;
Line-height: 15px;
Font-size: 12px;
Color: #000;
Display: block;
Text-align: center;
Cursor: hand;
Background-color: # F00;
Margin-left: 563px;
Border: 1px solid # CC3300;
}
. Neirong {
Width: 593px;
Margin: auto;
Background-color: # F90;
Border: 1px solid # CC3300;
Font-size: 12px;
Color: # FFF;
Padding: 5px;
}
Body {
Margin-top: 2px;
}
-->
</Style>
</Head>
<Body>
<Script>
Function show (n)
{
N. style. display = "block ";
}
Function hid (n)
{
N. style. display = "none ";
}
</Script>
<Div id = "shang">
<Li class = "l1">
<A class = "a2" href = "#" onmouseover = "this. style. backgroundColor = '# CC3300'; show (a1) "onmouseout =" this. style. backgroundColor = '# ff0000'; hid (a1) "> navigation bar (with subnavigation)
</A>
<Span id = "a1">
<A class = "a1" href = "#" onmouseover = "this. style. color = '# ffff'; show (a1) "onmouseout =" this. style. color = '# 8080'; hid (a1) "> subnavigation content </a>
<A class = "a1" href = "#" onmouseover = "this. style. color = '# ffff'; show (a1) "onmouseout =" this. style. color = '# 8080'; hid (a1) "> subnavigation content </a>
<A class = "a1" href = "#" onmouseover = "this. style. color = '# ffff'; show (a1) "onmouseout =" this. style. color = '# 8080'; hid (a1) "> subnavigation content </a>
<A class = "a1" href = "#" onmouseover = "this. style. color = '# ffff'; show (a1) "onmouseout =" this. style. color = '# 8080'; hid (a1) "> subnavigation content </a>
</Span>
</Li>
<Li class = "l1">
<A class = "a2" href = "#" onmouseover = "this. style. backgroundColor = '# CC3300'; "onmouseout =" this. style. backgroundColor = '# ff0000' "> navigation bar content
</A>
</Li>
<Li class = "l1">
<A class = "a2" href = "#" onmouseover = "this. style. backgroundColor = '# CC3300'; "onmouseout =" this. style. backgroundColor = '# ff0000' "> navigation bar content
</A>
</Li>
<Li class = "l1">
<A class = "a2" href = "#" onmouseover = "this. style. backgroundColor = '# CC3300'; "onmouseout =" this. style. backgroundColor = '# ff0000' "> navigation bar content
</A>
</Li>
</Div>
<Div class = "zhui" id =" div1 ">
<Div class = "yejiao" onclick = "div1.style. display = 'none'"> close </div>
<Div class = "neirong">
§ ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # the system crashes, and then changes accordingly.♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 § ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # the system crashes, and then changes accordingly.♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 § ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # the system crashes, and then changes accordingly.♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 § ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # the system crashes, and then changes accordingly.♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 § ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # the system crashes, and then changes accordingly.♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃ When your documents are in conflict # When your documents are in conflict with each other, then your documents are in conflict with each other. ▲△ ※※→ 〓 ↓ ° #@ & \ _ ︿  ̄ ―♂♀§ ☆★○ ◎ ● ◇ ◆ □℃, Then, and then # collapse? </Div>
</Div>
<Div class = "neirong" style = "text-align: center; background-color: # F00"> click "close! </Div>
</Body>
</Html>