本文共 270 字,大约阅读时间需要 1 分钟。
图片预览
_this:input[file]对象
_thisNext:下一个要操作的dom对象 cb:回调函数function changeImg(_this,_thisNext,cb){ var reader = new FileReader(); reader.readAsDataURL(_this.files[0]); reader.onload = function(e){ _this.nextSibling.src = e.target.result; if(cb){ cb(_thisNext); } }}
转载地址:http://lohi.baihongyu.com/