for(var i=0;i <3;i++)
{
var x = addToTd(i);
}
function addToTd(i)
{
var td = document.getElementById("show"+i); //得到td的id,分别为show0,show1,show2
var img = new Image();
img.src = imageUrl;
img.id = img.src;
img.onload = function(){
this.width = this.width/4
this.height = this.height/4
}
if(img.readyState != "complete") return 0; //没有加载完成的话,返回0.直到加载完成
td.innerHTML = "";
td.appendChild(img);
return 1;
}
{
var x = addToTd(i);
}
function addToTd(i)
{
var td = document.getElementById("show"+i); //得到td的id,分别为show0,show1,show2
var img = new Image();
img.src = imageUrl;
img.id = img.src;
img.onload = function(){
this.width = this.width/4
this.height = this.height/4
}
if(img.readyState != "complete") return 0; //没有加载完成的话,返回0.直到加载完成
td.innerHTML = "";
td.appendChild(img);
return 1;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货