二级菜单效果(2)

<!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>nav</title>
<script type=text/javascript>
<!--
var LastLeftID = "";

function DoMenu(emid){
	var obj = document.getElementById(emid); 
	obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
	if((LastLeftID!="")&&(emid!=LastLeftID)){
		document.getElementById(LastLeftID).className = "collapsed";
	}
		LastLeftID = emid;
}
-->
</script>

<style type="text/css">
<!--
ul,li,a{margin:0;padding:0;}

body {
 font-family: Arial,Verdana,Helvetica,sans-serif;
 font-size:12px;
}

#nav {
 width:180px;
 list-style-type: none;
 text-align:left;
 margin:10px 0 0 10px;
}

#nav a {
 width: 180px; 
 display: block;
 padding:5px 0 5px 20px;
}

#nav li {
 background:#cccccc;
 border-bottom:#ffffff 1px solid;
 float:left;
}

#nav li a:hover{
 background:#cc0000;
}

#nav a:link  {
 color:#666;
 text-decoration:none;
}

#nav a:visited  {
 color:#666;
 text-decoration:none;
}

#nav a:hover  {
 color:#ffffff;
 text-decoration:none;
 font-weight:bold;
}

#nav li ul {
 list-style:none;
 text-align:left;
 padding:0;
}

#nav li ul li{ 
 background: #ebebeb;
}

#nav li ul a{
 padding-left:20px;
 width:180px;
}

#nav li ul a:link  {
 color:#666;
 text-decoration:none;
}
#nav li ul a:visited  {
 color:#666;
 text-decoration:none;
}
#nav li ul a:hover {
 color:#f3f3f3;
 text-decoration:none;
 font-weight:normal;
 background:#cc0000;
}

#nav li:hover ul {
 left: auto;
}
#nav li.sfhover ul {
 left: auto;
}
#content {
 clear: left; 
}
#nav ul.collapsed {
 display: none;
}
-->
</style>
</head>
<body>
<ul id="nav">
	<li><a href="#Menu=ChildMenu1"  οnclick="DoMenu('ChildMenu1')">menu1</a>
		 <ul id="ChildMenu1" class="collapsed">
			 <li><a href="#">first</a></li>
			 <li><a href="#">second</a></li>
			 <li><a href="#">third</a></li>
			 <li><a href="#">forth</a></li>
			 <li><a href="#">fifth</a></li>
		 </ul>
	</li>
	<li><a href="#Menu=ChildMenu2" οnclick="DoMenu('ChildMenu2')">menu2</a>
		 <ul id="ChildMenu2" class="collapsed">
			 <li><a href="#">first</a></li>
			 <li><a href="#">second</a></li>
			 <li><a href="#">third</a></li>
			 <li><a href="#">forth</a></li>
			 <li><a href="#">fifth</a></li>
		 </ul>
	</li>
	<li><a href="#Menu=ChildMenu3" οnclick="DoMenu('ChildMenu3')">menu3</a>
		 <ul id="ChildMenu3" class="collapsed">
			 <li><a href="#">first</a></li>
			 <li><a href="#">second</a></li>
			 <li><a href="#">third</a></li>
			 <li><a href="#">forth</a></li>
			 <li><a href="#">fifth</a></li>
		 </ul>
	</li>
	<li><a href="#Menu=ChildMenu4" οnclick="DoMenu('ChildMenu4')">menu4</a>
		 <ul id="ChildMenu4" class="collapsed">
			 <li><a href="#">first</a></li>
			 <li><a href="#">second</a></li>
			 <li><a href="#">third</a></li>
			 <li><a href="#">forth</a></li>
			 <li><a href="#">fifth</a></li>
		 </ul>
	</li>
</ul>
</body>
</html>
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值