Jquery CSS div Popup two level menu code

Source: Internet
Author: User

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<script src= "jquery. Web Effects" ></script>
<style type= "Text/css" >
<!--
*{margin:0; padding:0; border:0;}
body{font-family:arial, XXFarEastFont-Arial, serif, font-size:12px;
#nav {width:180px; line-height:24px; list-style-type:none;text-align:left;}
#nav span{width:160px; display:block; padding-left:20px; cursor:pointer;}
#nav li{background: #ccc; Border-bottom: #fff 1px solid; float:left;
#nav a:link, #nav a:visited{color: #666; text-decoration:none;}
#nav a:hover{color: #fff; text-decoration:none; font-weight:bold;}
#nav Li dl{list-style:none text-align:left; border-top:1px solid #fff;
#nav li dl dd{background: #ebebeb; Border-bottom: #fff 1px solid;}
#nav Li dl a{padding-left:20px; width:160px; display:block;}
#parent {width:300px; padding-left:20px;}
. dis{Display:none;}
. ondis{Display:block;}
. onhover{background: #009900; color: #fff;}
. linkhover{background: #cc0000; color: #fff;}
. active{background: #00ccff; color: #666666;}
-->
</style>
<script type= "text/web Effects" >
<!--
$ (function () {
$ ("#nav Li"). each (function (i) {$ (this). Children ("DL"). addclass ("Dis");
$ (this). Children (). Click (function () {$ (this). Next (). Toggle (function () {$ (this). addclass ("Ondis");});
$ (this). Click (function () {$ (' #nav Li '). each (the function () {$ (this). FIND ("span"). Removeclass (); $ (this). Find (' span '). addclass ("Onhover");
});
})
$ (function () {$ ("#nav DL DD"). Hover (function () {$ (this). Children (). addclass ("Linkhover")},function () {$ (this). Children (). Removeclass ("Linkhover")})
-->
</script>
<title>jquery pop-up level two menu </title>
<body>
<div id= "Parent" >
<ul id= "NAV" >
<li><span>frist nav1</span>
<dl>
<dd><a href= "subnav1/" >http://down.111cn.net ">subnav1 menu1</a></dd>
<dd><a href= "#" >subnav1 menu2</a></dd>
<dd><a href= "#" >subnav1 menu3</a></dd>
<dd><a href= "#" >subnav1 menu4</a></dd>
</dl>
</li>
<li><span>frist nav2</span>
<dl>
<dd><a href= "subnav2/" >http://www.111cn.net ">subnav2 menu1</a></dd>
<dd><a href= "#" >subnav2 menu2</a></dd>
<dd><a href= "#" >subnav2 menu3</a></dd>
<dd><a href= "#" >subnav2 menu4</a></dd>
</dl>
</li>
<li><span>frist nav3</span>
<dl>
<dd><a href= "#" >subnav3 menu1</a></dd>
<dd><a href= "#" >subnav3 menu2</a></dd>
<dd><a href= "#" >subnav3 menu3</a></dd>
<dd><a href= "#" >subnav3 menu4</a></dd>
</dl>
</li>
<li><span>frist nav4</span>
<dl>
<dd><a href= "Http://mb.111cn.net" >subnav4 menu1</a></dd>
<dd><a href= "#" >subnav4 menu2</a></dd>
<dd><a href= "#" >subnav4 menu3</a></dd>
<dd><a href= "#" >subnav4 menu4</a></dd>
</dl>
</li>
</ul>
</div>
</body>

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.