问答详情
源自:10-1 编程挑战

懵逼了。。。。。。这段代码是啥意思?

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";
            }        
        }

提问者:Niro07 2016-09-19 20:55

个回答

  • 慕粉3719264
    2016-09-20 00:34:36
    已采纳

    切换  选项卡      给li进行编号  012    然后 div对这个012    对上了 让显示相应的 div