为什么鼠标移开的时候 效果没显示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#nav{
width: 200px;
height: 250px;
background: #cccccc;
}
#nav-a{
width: 100px;
height: 200px;
background: #56c;
}
li{
height: 20px;
width: 20px;
background: #000000;
border: 1px solid #ffffff;
}
</style>
<script type="text/javascript">
window.onload=function() {
var nav = document.getElementById('nav').getElementsByTagName('li');
for(var i=0;i<nav.length;i++)
nav[i].onmouseover = function () {
changea();
}
nav[i].onmouseout=function () {
changeb()
}
};
function changea() {
var aNav=document.getElementById('nav-a');
aNav.style.display='none';
}
function changeb() {
var aNav=document.getElementById('nav-a');
aNav.style.display='block';
}
</script>
</head>
<body>
<div id="nav">
<ul>
<li></li>
<li></li>
</ul>
</div>
<div id="nav-a"></div>
</body>
</html>