展开全部
使用一个闭包就搞定了
*{margin:0;padding:0;} #div1{position:absolute;} li{list-style-type:none;text-align:center;width:70px;height:30px;line-height:30px;}
#zg li{background:blue;float:left;} #zg li #bj li{background:green;} #zg
li #bj li #xc li{background:red;} #xc,#sjz{position:relative;left:70px;top:-30px;}
#dc{position:relative;left:70px;top:-60px;} #bj{display:none;} #hb{display:none}
#xc{display:none;} #dc{display:none;}
onload = function()
{
var lis = document.getElementsByTagName("li");
for (var i = 0; i
lis[i].onmouseover = function()
{
var p = this;
setTimeout(function() {
return function(parent) {
parent.children[0] ? parent.children[0].style.display = "block": 0;
} (p);
},
500);
}
lis[i].onmouseout = function()
{
this.children[0] ? this.children[0].style.display = "none": 0;
}
}
}
北京
西城区
西单
西单
西单
东城区
东单
东单
东单
崇文区
河北
石家庄636f707962616964757a686964616f31333337393030
桥东
桥东
桥东
保定
邢台