<script type="text/javascript">
window.onload = function() {
var oUl1 = document.getElementById("ul1");
var aLi = oUl1.getElementsByTagName("li");
var oDiv = document.getElementById("tab-list");
var aDiv = oDiv.getElementsByTagName("div");
for(var i = 0; i < aLi.length; i++) {
aLi[i].index = i;
aLi[i].onmouseover = function() {
for(var i = 0; i < aLi.length; i++) {
aLi[i].className = "";
}
this.className = "active";
for(var j = 0; j < aDiv.length; j++) {
aDiv[j].className = "hide";
}
aDiv[this.index].className = "show";
}
}
}
</script>
aLi[i].className = "";和aDiv[this.index].className = "show";触发三次之后怎么就和鼠标联系上了,为什么鼠标点哪就可以实现这个语句?(说的不太清楚,我也不知道该怎么说,见谅)
心上无垢
橋本奈奈未
相关分类