window.onload=function(){ "use strict"; a();b();};function a(){ "use strict"; var aLi=document.getElementsByClassName("main_list_li"); var oRank=document.getElementsByClassName("rank"); var oChange=document.getElementsByClassName("change"); for(var i=0; i<aLi.length; i++){ aLi[i].index=i; aLi[i].onmouseover=function(){ this.style.backgroundColor="#f5f5f5"; oChange[i].style.display="block"; oRank[i].style.display="none"; }; aLi[i].onmouseout=function(){ this.style.backgroundColor="#ffffff"; oChange[i].style.display="none"; oRank[i].style.display="block"; }; } } 第15行报错 Cannot read property 'style' of undefined
添加回答
举报
0/150
提交
取消