文件上传成功后,插件自己创建了一些div添加在了页面底部,不知道有没有遇到过,我想隐藏这几个div,但是插件的js中不知道是哪个方法创建呢,有没有大神提示一下
你上传代码发下 我这边没有你说的多余的div
/加载上传控件/
Initfileinput = function (uploadurl){
$("#file").fileinput({
//uploadUrl: "../fileinfo/save", // server upload action
language: 'zh', //设置语言
uploadUrl:uploadurl,
required: true,
showCaption: false,
showBrowse: true,
browseOnZoneClick: true,
dropZoneEnabled: false,
allowedFileExtensions: ['xlsx','xls'],
// allowedFileExtensions: ['txt', 'gif', 'png','xlsx','xls','doc','pdf','docx'],//只能选择xls,和xlsx格式的文件提交
//maxFileSize: 0,//单位为kb,如果为0表示不限制文件大小
/不同文件图标配置/
// previewFileType: ['image','html','text','flash','xlsx','xls','object'],
allowedPreviewTypes: ['image'],
previewFileIcon:'<i class="fa fa-file-o"></i>',
// previewFileIconSettings: null,
previewFileIconSettings: {
'docx': '<i class="fa fa-file-word-o text-primary" ></i>',
'xlsx': '<i class="fa fa-file-excel-o text-success"></i>',
'pptx': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
'jpg': '<i class="fa fa-file-photo-o text-warning"></i>',
'pdf': '<i class="fa fa-file-pdf-o text-danger"></i>',
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
'doc': '<i class="fa fa-file-word-o text-primary"></i>',
'xls': '<i class="fa fa-file-excel-o text-success"></i>',
'ppt': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
'pdf': '<i class="fa fa-file-pdf-o text-danger"></i>',
'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
'htm': '<i class="fa fa-file-code-o text-info"></i>',
'txt': '<i class="fa fa-file-text-o text-info"></i>',
'mov': '<i class="fa fa-file-movie-o text-warning"></i>',
'mp3': '<i class="fa fa-file-audio-o text-warning"></i>',
'jpg': '<i class="fa fa-file-photo-o text-danger"></i>',
'gif': '<i class="fa fa-file-photo-o text-muted"></i>',
'png': '<i class="fa fa-file-photo-o text-primary"></i>'
},
layoutTemplates:{ actionUpload:''},
/上传成功之后运行/
fileuploaded:$("#file").on("fileuploaded", function (event, data, previewId, index) {
var res = data.response.data;
console.log(res.fileName + "<<<<<<<<<<<<<<<fileName");
console.log(res.filePath + "<<<<<<<<<<<<<<<filePath");
$("#departmentInfo").val($("#departmentInfo").val() +","+res.filePath);
$("#departmentInfoName").val($("#departmentInfoName").val() +","+res.fileName);
// var path = $("#departmentInfo").val();
console.log("Upload success");
}),
/*上传出错误处理*/
fileerror:$('#file').on('fileerror', function(event, data, msg) {
console.log("Upload failed")
}),
});
}
我觉得不是我这块上传代码的问题,应该是它本身的js有什么地方执行了
@little_sun: 你搜下代码里 清除选中文件 看看在什么地方