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

为什么js部分不能用display属性来隐藏和显示呢

for(var i= 0,len = oLis.length;i<len;i++){
                 oLis[i].index = i;
                 oLis[i].onclick = function() {
                     for(var n= 0;n<len;n++){
                         oLis[n].className = "";
                         oDivs[n].className = "hide";
                     }
                     this.className = "on";
                     oDivs[this.index].className = "";
                 }
             };

提问者:慕数据1727510 2018-07-31 21:21

个回答

  • 刺心丶
    2018-08-03 14:45:39

    结构可能会乱