实现图片、或者头像的上传,并且本地浏览,今天我们就要用到H5新的Web API 接口FileReader 。
IE10以下的版本不支持FileReader()构造函数.不过可以利用滤镜来兼容旧版本的IE:兼容IE的图片本地预览。
CSS代码:
<style>
.box1{
width: 200px;
height: 40px;
border-radius: 4px;
border: 2px dashed red;
line-height: 40px;
margin: 0px auto;
background: greenyel