Navigation menu (move to show sub-menu), navigation menu sub-menu

Source: Internet
Author: User

Navigation menu (move to show sub-menu), navigation menu sub-menu

The Code is as follows:

<! DOCTYPE html> 



Move the mouse over a menu on the webpage, and a row of sub-menus are displayed below

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "www.w3.org/..al.dtd">
<Html xmlns = "www.w3.org/5o/xhtml">
<Head>
<Title> simple and practical secondary drop-down menu </title>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Style type = "text/css">
Body {
Text-align: center;
Font-size: 12px;
}

Ul {
Padding 0;
Margin: 0;
List-style: none;
}
Li {
Position: relative;
Float: left;
Width: 110px;
}
Li ul {
Position: absolute;
Display: none;
Top: 20px; left: 30px;
}
Li: hover ul, li. over ul {
Display: block;
}

</Style>
<Script type = "text/javascript">
StartList = function (){
If (document. all & document. getElementById ){
NavRoot = document. getElementById ("nav ");
For (I = 0; I <navRoot. childNodes. length; I ++ ){
Node = navRoot. childNodes [I];
If (node. nodeName = "LI "){
Node. onmouseover = function (){
This. className + = "over ";
}
Node. onmouseout = function (){
This. className = this. className. replace ("over ","");
}
}
}
}
}
Window. onload = startList;
</Script>
</Head>
<Body>
<! -- Add the following code to the <body ...... remaining full text>

Aspnet uses the menu Control for navigation to achieve horizontal menu, move the mouse over the menu item, and how does the xml of the sub-menu effect pop-up below?

<? Xml version = "1.0" encoding = "UTF-8"?>
-<Menus>
-<MenuItem>
<Text> 1 </Text>
<ItemID> 1000 </ItemID>
<ParentItemID> 0 </ParentItemID>
<IsModule> 1 </IsModule>
<Level> 1 </Level>
</MenuItem>
-
-<MenuItem>
<Text> 1 </Text>
<ItemID> 100001 </ItemID>
<ParentItemID> 1000 </ParentItemID>
<IsModule> 0 </IsModule>
<Level> 2 </Level>
</MenuItem>
-<MenuItem>
<Text> 2 </Text>
<ItemID> 100002 </ItemID>
<ParentItemID> 1000 </ParentItemID>
<IsModule> 0 </IsModule>
<Level> 2 </Level>
</MenuItem>
-<MenuItem>
<Text> 2 </Text>
<ItemID> 1100 </ItemID>
<ParentItemID> 0 </ParentItemID>
<IsModule> 1 </IsModule>
<Level> 1 </Level>
</MenuItem>
-<MenuItem>
<Text> 1 </Text>
<ItemID> 110001 </ItemID>
<ParentItemID> 1100 </ParentItemID>
<IsModule> 0 </IsModule>
<Level> 2 </Level>
</MenuItem>
-<MenuItem>
<Text> 2 </Text>
<ItemID> 110002 </ItemID>
<ParentItemID> 1100 </ParentItemID>
<IsModule>... the remaining full text>

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.