js+ajax 上传多图片,并删除
2021-02-15 11:19
标签:ant hide ddc item radius 多图 function 重复 imp js+ajax 上传多图片,并删除 标签:ant hide ddc item radius 多图 function 重复 imp 原文地址:https://www.cnblogs.com/yun101/p/12986388.htmldiv class="df mb20">
input type="text" readonly placeholder="请选择图片" class="form-control col-sm-6">
input type="text" style="width: 100px;" readonly value="请选择图片" class="btn btn-default" >
input type="file" id="picture" name="cover" multiple class="btn btn-default" style="width: 100px;height:35px;line-height:85px;position: absolute;right: 15px;z-index: 1;background: transparent;" />
input type="hidden" name="s_imgpath[]" id="s_imgpath" >
div>
div id="previewImg" style="display: flex;justify-content: flex-start;align-items: flex-start;">div>
style>
#previewImg div{margin-right: 10px;margin-bottom: 10px;}
.hide{display: none !important;}
#previewImg div{position: relative;}
.show{width: 20px;height: 20px;background: #0275D8;border-radius: 50%;position:absolute;top: 0;right: 0;z-index: 99}
.show::after{content: ‘x‘;color: #fff;width:20px;text-align: center;position: absolute;top:0;left: 0;right: 0;bottom: 0;margin:0 auto;}
style>
// 多张图片
var arr=[]
$(‘#picture‘).on(‘change‘, function(){
var imgFiles = $(this)[0].files
console.log("多张图片",imgFiles)
var formData = new FormData();
for (i=0;i