let it be
行到水穷处 坐看云起时

<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
*{margin:0px; padding:0px; border=0; list-style:none; font-family:verdana;}

#nav{font-size:10pt}

#nav a{text-decoration:none}
#nav a:link{color:#999}
#nav a:visited{color:#999}
#nav a:hover{color:black}
#nav a:active{color:#999}

#nav li{width:120px; padding:4px; border:solid 1px; margin:3px; text-align:center; position:relative} /* 整个一级菜单占的长度120+4+1+3=128px */

#nav li ul{display:none; position:absolute; left:129px; top:-4px; background:#fff} /*padding:4px,利用display:none隐藏菜单,background:#fff用于填充空隙,否则IE中有问题*/

/*important for ff */
#nav li ul li a{display:inline-block; background:#eee; border:solid 1px; width: 120px} /*用display将a转化为块元素,为右弹效果做准备*/
#nav li ul li a{display:inline-block}
/*设置带链接子菜单的外观*/
#nav li ul li a:link{color:black}
#nav li ul li a:visited{color:black}
#nav li ul li a:hover{position:relative; left:8px} /*右弹的效果*/
#nav li ul li a:active{color:black}

#nav li:hover ul, #nav li.over ul{display:block} /*显示被隐藏的菜单*/

</style>
<script type="text/javascript">
var a = function()
{
var nav = document.getElementById('nav');
var lis = nav.childNodes;
for(var i = 0;i<lis.length;i++)
{
if(lis[i].nodeName=='LI')
{
var childLi = lis[i];
childLi.onmouseover = function(){this.className='over';}
childLi.onmouseout = function(){this.className='';}
}
}
}
window.onload = a;
</script>
</head>
<body>
<ul id="nav">
<li><a href="#1">产品介绍</a>
<ul>
<li><a href="#1">Link</a></li>
</ul>
</li>
<li>产品介绍
<ul>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
</ul>
</li>
<li>产品介绍
<ul>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
</ul>
</li>
<li>产品介绍
<ul>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
</ul>
</li>
<li>产品介绍
<ul>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
<li><a href="#1">Link</a></li>
</ul>
</li>
</ul>
</body>
</html>

posted on 2011-11-30 13:27  流浪浪  阅读(525)  评论(0编辑  收藏  举报