有谁能告诉我,加了java脚本,ie6还是显示不了下拉菜单
这是java脚本代码:<script type="text/javascript" language="javascript">navhover=function(){
var lis=document.getElementByld("navlist").getElementByTagName("LI");
for(var i=0;i<lis.length;i++){
lis[i].onmouseover=function(){
this.className+="iehover";
}
lis[i].onmouseout=function(){
this.className=this.className.replace(new RegExp("iehover\\b"),"");
}
}
}
if(window.attachEvent)window.attachEvent("onload",navhover);
</script>
这是css代码和html的标记代码:<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>制作下拉式导航条</title>
<style type="text/css">
<!--
ul {
margin: 0px;
padding: 0px;
list-style:none;
}
ul li {
float: left;
width: 160px;
}
li ul {
display: none;
top:20px;
}
li:hover ul,li.over ul {
display: block;
}
ul li a {
font-size: 12px;
color: #777;
text-decoration: none;
display: block;
padding: 3px;
border: 1px solid #ccc;
}
ul li a:hover {
background-color: #f4f4f4;
}
-->
</style>
</head>
<body>
使用ul列表标签以及css实现样式来制作下拉式导航条
<ul id="navlist">
<li><a href="">文章</a>
<ul>
<li> <a href="">css教程</a></li>
<li> <a href="">dom教程</a></li>
<li> <a href="">xml教程</a></li>
</ul>
</li>
<li><a href="">参考</a>
<ul>
<li> <a href="">xhtml</a></li>
<li> <a href="">xml</a></li>
<li> <a href="">css</a></li>
</ul>
</li>
<li><a href="">blog</a>
<ul>
<li> <a href="">全部</a></li>
<li> <a href="">网页技术</a></li>
<li> <a href="">ui技术</a></li>
<li> <a href="">flash技术</a></li>
</ul>
</li>
</ul>
</body>
</html>