html页面部分:
<div style="height:30px;vertical-align: top;">
<input type="button" value="添加图片" id="btnAdd"
οnclick="selectAttachment();" style="float:left;" />
<input type="button"
value="清空图片" id="btnClear" style="margin-left:8px;float:left;display: none"
οnclick="clearAttachment();" /><p style="font-size: 12px;font-color:#8A9BA8;border:0px;cursor:default;" >第一张默认为封面,每张最大10MB,支持jpg/gif/png格式 </p>
</div>
<div id="attachmentList"
style="width: 600px;margin: 3px 0px 0px 0px; padding: 4px 3px 4px 3px; background-color: #8FBC8F; display: none; border: 1px solid #8A9BA8;">
</div>
<div id="total" style="margin: 3px 0px 0px 0px;display:none">当前选择上传0个附件</div>
<div id="preview" style="height: 100px;display:none">
<!-- 图片预览区域 -->
</div>
js部分:
/*图片预览之后上传*/
//图片上传预览 IE是用了滤镜。
var i = 0; // 用来动态生成span,upfile的id
function addAttachmentToList(file) {
var theEvent = window.event || arguments.callee.caller.arguments[0];
obj = theEvent.srcElement ? theEv