求大神帮我看看这段代码哪里有问题,我想实现通过setInterval函数实现的区域信息轮播功能
window.onload = function() {
var oUl1 = document.getElementById("ul1");
var aLi = oUl1.getElementsByTagName("li");
var oDiv = document.getElementById("text-list");
var aDiv = oDiv.getElementsByTagName("div");
aLi[0].className="active";
aDiv[0].className="show"; //以上两行代码设置初始显示位置
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";
}
}
//以上代码实现onmouseover功能
var a=0;
while(a<=10){
a++;
setInterval("divChange()",10000);
}
function divChange(){
for(var i=0;i<aLi.length;i++)
{
for(var k = 0; k < aLi.length; k++) {
aLi[k].className = "";
}
aLi[i].className="active";
for(var j = 0; j < aDiv.length; j++) {
aDiv[j].className = "hide";
}
aDiv[i].className="show";
}
}
}
// 问题代码