满意答案
真心vb30
2017.12.08
采纳率:59% 等级:9
已帮助:514人
HTML>
Page Titlevar row=2,col=11,size=20,gap=5;
window.οnlοad=function(){
var wrap=document.createElement("div");
wrap.style.margin="0 auto";
wrap.style.width=(size+gap)*col+"px";
for(var i=0;i
var rows=document.createElement("div");
rows.style.float="left";
rows.style.marginBottom=gap+"px";
for(var j=0;j
var div=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分享举报