<html>
<head>
<TITLE>下拉菜單</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>mynav</title>
<script language="javascript">
//為各個菜單項定義鼠標(biāo)事件
startList = function()
{
if (document.all&&document.getElementById) {
navRoot = document.getElementById("mynav");//找到菜單根目錄
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over"; }
node.onmouseout=function() {
this.className=this.className.replace(" over", ""); }
}
}
}
}
window.onload=startList;
</script>
<style type="text/css">
body
{ font: normal 11px verdana; }
ul {
margin: 0;
padding: 0;
list-style: none;
width: 150px;
border-bottom: 1px solid #ccc;
}
ul li
{ position: relative; }
li ul {
position: absolute;
left: 149px;
top: 0;
display: none;
}
/* 菜單項的樣式 */
ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff;
padding: 5px;
border: 1px solid #ccc;
border-bottom: 0;
}
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
li:hover ul, li.over ul { display: block; }
</style>
</head>
<body>
<ul id="mynav">
<li><a href="#">首頁</a></li>
<li><a href="#">幫助</a>
<ul>
<li><a href="#">歷史</a></li>
<li><a href="#">團隊</a></li>
<li><a href="#">辦公室</a></li>
</ul>
</li>
<li><a href="#">客服</a>
<ul>
<li><a href=" <li><a href="#">網(wǎng)絡(luò)銷售</a></li>
<li><a href="#">站點服務(wù)</a></li>
<li><a href="#">區(qū)域服務(wù)</a></li>
</ul>
</li>
<li><a href="#">聯(lián)系方式</a>
<ul>
<li><a href="#">國家</a></li>
<li><a href="#">城市</a></li>
<li><a href="#">地址</a></li>
<li><a href="#">電話</a></li>
</ul>
</li>
</ul>
</body>
</html>