二级JS菜单
来源:互联网 发布:电视台回看软件 编辑:程序博客网 时间:2024/04/28 05:02
近日一个项目用到一个二级JS菜单,先将代码记录在此,以便下次利用:
<head>
<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
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>
<link href="css/2008_style.css" rel="stylesheet" type="text/css" />
<style>
ul {
margin: 0;
padding: 0;
list-style: none;
text-align:left;
width: 130px; /* Width of Menu Items */
border-bottom: 0px solid #ccc;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 129px; /* Set 1px less than menu width */
top: 0;
display: none;
}
/* Styles for Menu Items */
ul li a {
display: block;
text-decoration: none;
color:#555;
background: #fff; /* IE6 Bug */
padding:3px 0;
border: 0px solid #ccc;
border-bottom: 0;
}
/* Fix IE. Hide from IE Mac /*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
ul li a:hover { color: #1e58a0; background: #f6f8f8; } /* Hover Styles */
li ul li a { padding: 2px 5px; } /* Sub Menu Styles */
li:hover ul, li.over ul { display: block; } /* The magic */
</style>
</head>
<body>
<ul id="nav">
<li><a href="#">a1</a>
<ul>
<li><a href="#">a1</a></li>
</ul>
</li>
<li><a href="#">a2</a>
<ul>
<li><a href="#">a1</a></li>
<li><a href="#">a2</a></li>
</ul>
</li>
</ul>
</body>
- js二级联动菜单
- 二级JS菜单
- js二级菜单
- js级联菜单--二级
- js 二级联动菜单
- JS二级联动菜单
- js 二级联动菜单
- js二级下拉菜单
- js二级联动菜单
- js 下拉二级菜单
- js二级联动菜单
- js 创建二级菜单
- js二级菜单
- js 二级联动菜单
- js-----二级菜单联动
- JS二级连动菜单
- JS省市二级联动菜单
- 二级下拉关联菜单 js
- 发现自己被google俘虏了
- HTC 编程思想 作者:Hmily
- test
- 关于百度收录,加入联盟不会影响收录,投放广告代码也不影响
- 40个技巧优化你的php代码
- 二级JS菜单
- 十个习惯让你精通新的开发技术(好帖收藏)
- 如何推销自己的论文(水货级)--西米的blog
- 【英语学习】alpha girl:精英女生
- 国际:十个习惯让你精通新的开发技术
- 怎么在struts中配置数据源
- 绿色的google 商店 google store
- 理解离散傅立叶变换(三.复数)
- 提高质量:不留小问题