A method of uploading multiple images using layui

An Yuwei 2022-05-14 15:03:34 阅读数:512

methoduploadingmultipleimagesusing

To achieve the effect of :

js:

 <script>
var multiple_images = [];
// Click picture to delete the picture 【 Register global functions 】
function delMultipleImgs(this_img){
// Get subscript
var subscript=$("#div-slide_show img").index(this_img);
// Delete pictures
this_img.remove();
// Delete array
multiple_images.splice(subscript, 1);
// reorder
multiple_images.sort();
$('.multiple_show_img').val(multiple_images);
// return
return ;
}
layui.use([ 'upload'], function () {
var upload = layui.upload;
// Upload more pictures
upload.render({
elem: '#multiple_img_upload'
,url: "{:url('content/upimgs')}"
,multiple: true
,before: function(obj){
// Pre read local file example ,
版权声明:本文为[An Yuwei]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/134/202205141459271814.html