zjq:modify mutipy picture

This commit is contained in:
lovelyzhang 2016-12-25 15:10:05 +08:00
parent 775a8b2f6f
commit e934a901ee
2 changed files with 1680 additions and 11 deletions

View File

@ -38,9 +38,10 @@
<div class="form-group">
<div class="col-md-12">
<div id="image-upload">
<div id="total">当前选择上传0个图片</div><input class="btn btn-default" type="button" value="添加图片" id="btnAdd" onclick="selectAttachment();">&nbsp;
<input type="button" value="清空图片" id="btnClear" style="display:none" onclick="clearAttachment();">
<div id="attachmentList"></div>
<div id="total">当前选择上传0个图片</div>
<input class="btn btn-default" type="button" value="添加图片" id="btnAdd" onclick="selectAttachment();">&nbsp;
<input class="btn btn-default" type="button" value="清空图片" id="btnClear" style="display:none" onclick="clearAttachment();">
<div id="attachmentList" style="display: none"></div>
</div>
</div>
</div>
@ -87,14 +88,14 @@
var i = 0; // 用来动态生成span,upfile的id
function addAttachmentToList() {
if (findAttachment(event.srcElement.value)) return; //如果此文档已在图片列表中则不再添加
// 动态创建图片信息栏并添加到图片列表中
var span = document.createElement('span');
span.id = '_attachment' + i;
span.innerHTML = extractFileName(event.srcElement.value) + '&nbsp;<a href="javascript:delAttachment(' + (i++) + ')"><font color="blue">删除</font></a><br/>';
span.title = event.srcElement.value;
G('attachmentList').appendChild(span);
if(extractFileName(event.srcElement.value)) {
// 动态创建图片信息栏并添加到图片列表中
var span = document.createElement('span');
span.id = '_attachment' + i;
span.innerHTML = extractFileName(event.srcElement.value) + '&nbsp;<a href="javascript:delAttachment(' + (i++) + ')">删除</a><br/>';
span.title = event.srcElement.value;
G('attachmentList').appendChild(span);
}
// 显示图片列表并变换添加图片按钮文本
if (G('attachmentList').style.display == 'none') {
G('btnAdd').value = '继续添加';

File diff suppressed because it is too large Load Diff