Javascript +css Horizontal Level three navigation menu

Source: Internet
Author: User
Tags window xmlns
css|javascript| Menu | navigation

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>ĵ</title>
<style>
Body {
margin:7px;
font:12px Verdana, Arial, Helvetica, Sans-serif;
}
* {
List-style-type:none;
margin:0px;
padding:0px;
Border:thin none;
}
#nav {
Position:absolute;
font-size:9px;
opacity:0.8;
}
#nav a {
Display:block;
width:100px;
height:15px;
padding:3px 5px 12px;
Background: #666;
Color: #fff;
Text-decoration:none;
}
#nav A:hover {
Background: #333;
}
#nav Li {
width:120px;
height:30px;
Overflow:hidden;
Background: #ccc;
padding-bottom:3px;
}
#nav ul {
Position:absolute;
margin-left:110px;
Margin-top: -30px;
}
Html>body #nav ul {
margin-left:119px;
Margin-top: -39px;
}
#nav ul {
Display:none;
}
#nav Li.show ul {
Display:block;
}
#nav Li.show Li ul
Display:none;
}
#nav Li Li.show ul {
Display:block;
}
</style>
<script language= "javascript" type= "Text/javascript" >
function Menufix () {
var sfels = document.getElementById ("Nav"). getElementsByTagName ("Li");
for (var i=0; i<sfels.length; i++) {
Sfels[i].onmouseover=function () {
this.classname+= (this.classname.length>0?) "": "") + "show";
}
Sfels[i].onmouseout=function () {
This.classname=this.classname.replace (New RegExp (? | ^), "show\\b");
}
}
}
Window.onload=menufix;
</script>

<body>
<ul id= "NAV" >
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a>.</li>
<li><a href= "#" >nav item</a>.</li>
</ul>
</li>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
</ul>
</li>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
</ul>
</li>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
</ul>
</li>
</ul>
</li>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
</ul>
</li>
<li><a href= "#" >nav Item</a>
<ul>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
<li><a href= "#" >nav item</a></li>
</ul>
</li>
</ul>
</body>

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><ptml xmlns=" http://www.w3.org/1999/xhtml "><pead><meta http-equiv=" Content-type "content=" text/html; Charset=utf-8 "/><title>ĵ</title><style>body {margin:7px; font:12px Verdana, Arial, Helvetica, Sans-serif; * {list-style-type:none; margin:0px; padding:0px; Border:thin none; #nav {position:absolute; font-size:9px; opacity:0.8;} #nav a {display:block; width:100px; height:15px; padding:3px 5px 12px; Background: #666; Color: #fff; Text-decoration:none;} #nav a:hover {background: #333;} #nav Li {width:120px; height:30px; Overflow:hidden; Background: #ccc; padding-bottom:3px;} #nav ul {position:absolute; margin-left:110px; Margin-top: -30px;} Html>body #nav ul {margin-left:119px; Margin-top: -39px;} #nav ul {display:none;} #nav li.show ul {display:block;} #nav Li.show Li ul Display:none;} #nav Li Li.show ul {display:block;} </style><script language= "javascript" type= "Text/javascript" >function Menufix () {var sfels = document.getElementById ("Nav"). getElementsByTagName ("Li"); for (var i=0; i<sfels.length; i++) {sfels[i].onmouseover=function () {this.classname+= (THIS.CLASSNAME.LENGTH&G T;0? "": "") + "show"; } sfels[i].onmouseout=function () {this.classname=this.classname.replace (? | ^), "show\\b"); }}}window.onload=menufix;</script></pead><body><ul id= "Nav" > <li><a href= "#" > Nav Item</a> <ul> <li><a href= "#" >nav Item</a> <ul> <li><a href= "#" >nav item</a>.</li> <li><a href= "#" >nav it em</a>.</li> </ul> </li> <li><a href= "#" >nav Item</a> <ul> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" ; Nav item</a></li> <li><a href= "#" >nav item</a></li> href= "#" >nav item</a></li> <li><a href= "#" >nav item</a></li> ; Li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a> </li> </ul> </li> <li><a href= "#" >nav Item</a>. <ul> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav ite M</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "# ">nav item</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a>&lt ;/li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item& Lt;/a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" & Gt;nav item</a></li> <li><a href= "#" >nav item</a></li> A href= "#" >nav item</a></li> </ul> </li> <li><a href= "#" >nav Item </a>. <ul> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav ite M</a></li> <li><a href= "#" >nav item</a></li> <li><a href= "# ">nav item</a></li> <li><a href=" # ">nav item</a></li> Lt;ahref= "#" >nav item</a></li> </ul> </li> </ul> </li> <li><a href= "#" >nav Item</a> <ul> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a& Gt;</li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item&lt ;/a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav ite m</a></li> </ul> </li> <li><a href= "#" >nav Item</a> <ul> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item</a& Gt;</li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav item&lt ;/a></li> <li><a href= "#" >nav item</a></li> <li><a href= "#" >nav ite m</a></li> </ul> </li></ul></body></ptml>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



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.