<!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" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Document</title>
<link rel="stylesheet" type="text/css" href="project1.css" />
<script src="project1.js"></script>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
img{
border:0;
}
ol, ul ,li{list-style: none;}
a{text-decoration:none }
.nav{width:260px;position: relative;box-sizing: border-box;background: #fff;display: block;margin-left: 20px;}
.nav ul li {margin-left: 20px;color: #fff;background: #31302a;line-height: 65px;border-bottom: 1px solid #ccc;}
.nav ul li: hover {color: #000;background: #fff;}
.nav-one{position: relative;color: #fff;background: #31302a;height:60px;line-height: 60px;padding-left:20px;}
.nav-two{position: relative;color: #000;background: #fff;height:45px;line-height: 45px;padding-left:30px;}
.nav-two:hover {color: lightblue;background: #272822;}
.nav-three{position: relative;color: #000;height:40px;line-height: 40px;cursor: pointer;}
.nav-two-father{display: none;}
.nav-three-father{display: none;}
.nav ul li ul li {position: relative;color: #000;background: #fff;line-height: 45px;padding-left:30px;}
</style>
</head>
<body>
<div class="nav">
<ul>
<li>
<a href="#" class="nav-one"
onclick="clicks()">一级类目</a>
<ul class="nav-two-father" id="open">
<li>
<a href="#" class="nav-two"
onclick="boxp()"
>二级类目</a>
<ul class="nav-three-father"
id="box">
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#" class="nav-one"
onclick="clicks()">一级类目</a>
<ul class="nav-two-father" id="open">
<li>
<a href="#" class="nav-two"
onclick="boxp()"
>二级类目</a>
<ul class="nav-three-father"
id="box">
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
<li class="nav-three">三级类目</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<script type="text/javascript">
var i = 1;
var x = 1;
function clicks()
{
i++;
if( i%2 ==0){
document.getElementById("open").style.display = "block" ;
}
else{
document.getElementById("open").style.display = "none" ;
}
}
function boxp()
{
x++;
if( x%2 ==0){
document.getElementById("box").style.display = "block" ;
}
else{
document.getElementById("box").style.display = "none" ;
}
}
</script>
</body>
</html>
</script>