springMvc+webUploader图片从后台取出,回显后,添加图片删除功能

$list.on("click", "#iIcon", function() {
picNum -= 1;
var Id = $(this).parent().attr("id");
if(Id.indexOf("KUEMS_")<0){
uploader.removeFile(uploader.getFile(Id, true));
}

$(this).parent().parent().remove();
$("#photos").attr("value", getAllFilePath());
alert($("#photos").val());
var li = $("#fileList li").length - 1;
if (li >= 3) {
$("#filePicker").css("display", "none");
}
if (li < 3) {
$("#upload").css("display", "none");
$("#filePicker").css("display", "block");
}
});

CheckLength();

function CheckLength() {
var sumLength;
var li = $(".thumbsInfo ul li").length;
var iLenght3 = $('#fileList input:hidden').length;
sumLength = li + iLenght3;
$("#changeText").html("(" + (sumLength) + "/5)");
if (sumLength < 5) {
$("#fileList").css("display", "block");
}
}
}

function getAllFilePath() {
var path = "";
var input = $('#fileList .upload-state-done input:hidden');
if (input.length > 0) {
for (var i = 0; i < input.length; i++) {
path = path + input[i].value + ",";
}
}
return path;
}

你可能感兴趣的:(springMvc+webUploader图片从后台取出,回显后,添加图片删除功能)