超酷的菜单,写了我一天,快传播一下,比绞特别,火孤与ie都支持,代码超简单
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>dsafdsafdsalf</title>
<style type="text/css">
<!--
body{
color: #990000;
font-size:12px;
margin-left: 0px;
margin-top: 0px;
}
.style_1{
border-bottom:#000000 1px dashed;
border-top: #000000 1px dashed;
border-left: 1px #000000 dashed;
border-right:1px #000000 dashed;
width:150px;
height:22px;
text-align:center;
padding:2px;
}
.style_2{
padding:4px;
width:142px;
height:14px;
background-color:#CBE0FE;
}
-->
</style>
</head>
<body>
<div style="width:150px;">
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(1)">焦点新闻</a></div></div>
<div id="tb1" style="display:none;">
safdasfdsafsdaf
safdasfdsafsdaf
safdasfdsafsdaf
safdasfdsafsdaf
safdasfdsafsdaf
safdasfdsafsdaf
</div>
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(2)">最新供应信息</a></div></div>
<div id="tb2" style="display:none;">fdsafdsaf</div>
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(3)">最新供应信息</a></div></div>
<div id="tb3" style="display:none;">fdsafdsaf</div>
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(4)">最新供应信息</a></div></div>
<div id="tb4" style="display:none;">fdsafdsaf</div>
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(5)">最新供应信息</a></div></div>
<div id="tb5" style="display:none;">fdsafdsaf</div>
<div class="style_1"><div class="style_2"><a href="javascript:hidden_div(6)">最新供应信息</a></div></div>
<div id="tb6" style="display:none;">fdsafdsaf</div>
</div>
<script language="javascript">
var obj;
function hidden_div(v){//当鼠标点击树形结构标题栏时开始隐藏所有div
for(var i=1;i<7;i++){//共有6个div需要隐藏
obj = eval("tb"+i);
if(i == v){//看是否是用户所点击的div,是则看其div层状态是否打开或是关闭
if(obj.style.display == "block"){//如果打开
obj.style.display = "none"//则关掉
}else{//否则打开
obj.style.display = "block"
};
}else{
obj.style.display = "none";//如果不是用户所点的div则隐藏
};
};
}
</script>
</body>
</html>