Uploadify 上传后的文件删除,上传队列无法更新问题
1. 定义一个上传限制数量 var uploadLimit = 3;
2. 点击页面的删除图片成功后,将uploadLimit++操作
3. 通过uploadify的settings方式重置上传限制数量,例如
$('#file_upload').uploadify('settings','uploadLimit', ++uploadLimit);
参考的http://www.xuebuyuan.com/1422566.html
实际中用于删除图片
$(document).on('click','.Upload-img i',function(){ $data = $('#file_upload').data('uploadify');//获取上传文件的属性 settings = $data.settings; //settings.uploadLimit++;//增加上传数量 var uploadLimit=settings.uploadLimit;//获取当前设置的上传文件数限制 var _this = $(this); $('#file_upload').uploadify('settings','uploadLimit', ++uploadLimit);//重置增加上传文件数 $.each(pictures,function(index,item){ if(item.picUrl==_this.prev('img').attr('picurl')){ pictures.splice(index,1); return false; } }); console.log(pictures) $(this).parent().remove(); console.log(settings.uploadLimit); })