var clea=document.getElementById("clearfix");
var cl=clea.getElementsByTagName("li");
var show=clea.getElementsByClassName("show");
for(var i=0;i<cl.length;i++){
cl[i].onmouseover=function() {
this.style.marginTop = "-35px"; 鼠標移入改變<li>的高度
show.style.backgroundColor="red" (這是錯誤代碼)鼠標移入改變<li>內(nèi)的div樣式
}
cl[i].onmouseout=function(){
this.style.marginTop="0px";
}
js怎么寫:<ul>內(nèi)有3個<li>鼠標移入時改變li內(nèi)某個div的樣式
米脂
2018-08-14 10:09:10