js上传图片-预览图片
http://www.cnblogs.com/fsjohnhuang/p/3925827.html
https://github.com/fsjohnhuang/preview/releases/tag/v1.2.0
if (isRender(_, _.fileEl.files[0].name, isExpectedMIME)){ if (!img){ img = new Image(); img.className = imgCls;
// img.style.width = previewEl.offsetWidth + 'px';
// img.style.height = previewEl.offsetHeight + 'px';
// previewEl.appendChild(img);
} img.src = src; img.style.width = "200px";
alert("2图片的宽度为"+img.width+",2长度为"+img.height);
// img.style.height = img.offsetHeight;
img.onload = function(){
alert("图片的宽度为"+this.width+",长度为"+this.height);
previewEl.appendChild(img);
var imgwidth = img.width;
var imgheight = img.height;
alert(imgwidth + "," + imgheight);
};
}
文章属性
- 文章热度:1590
- 文章标签:标签: js上传 上传图片预览
- 生产日期:2017-1-6 14:42 Friday
- « 微信授权登录 | phpstorm10安装»
精彩评论