满意答案
真心vb30
.12.08
采纳率:59%等级:9
已帮助:514人
HTML>
PageTitle
varrow=2,col=11,size=20,gap=5;
window.οnlοad=function(){
varwrap=document.createElement("div");
wrap.style.margin="0auto";
wrap.style.width=(size+gap)*col+"px";
for(vari=0;i
varrows=document.createElement("div");
rows.style.float="left";
rows.style.marginBottom=gap+"px";
for(varj=0;j
vardiv=document.createElement("img");
div.src="a.png";
div.style.width=size+"px";
div.style.height=size+"px";
div.style.float="left";
div.style.marginLeft=gap+"px";
div.οnclick=function(){
!this.abc?this.src="b.png":this.src="a.png";
this.abc=!this.abc;
}
rows.appendChild(div);
}
wrap.appendChild(rows);
}
document.body.appendChild(wrap);
}
00分享举报