如何控制上传的图片大小
function load_img(){
var img =new Image();
img.width=12;
img.height=400;
//document.animation.src='Public/Uploads/Products/1251796608.jpg';
img.setAttribute('src', 'Public/Uploads/Products/1251796608.jpg');
document.getElementById('show_pic').appendChild(img); //添加显示区域div
}这什么以上的代码无法控制图像大小 var img1=document.createElement("img1");
img1.src=FilePath;
img1.setAttribute('id', "get_size_img");
temp_img.insertAdjacentElement("beforeend",img1);
用这个无法在 temp_img.insertAdjacentElement("beforeend",img1);之前得到图片的大小不明白该如何做了
function load_img(){
var img =new Image();
img.width=12;
img.height=400;
//document.animation.src='Public/Uploads/Products/1251796608.jpg';
img.setAttribute('src', 'Public/Uploads/Products/1251796608.jpg');
document.getElementById('show_pic').appendChild(img); //添加显示区域div
}这什么以上的代码无法控制图像大小 var img1=document.createElement("img1");
img1.src=FilePath;
img1.setAttribute('id', "get_size_img");
temp_img.insertAdjacentElement("beforeend",img1);
用这个无法在 temp_img.insertAdjacentElement("beforeend",img1);之前得到图片的大小不明白该如何做了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货