Blueimp jQuery File Uploadプラグインを使用しています。構成は次のとおりです。
$("#fileupload").fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: "assets/plugins/jquery-file-upload/server/php/",
done: function (e, data) {
//some code
}
});
1つのファイルのアップロードが完了したら、このファイルをリストから非表示にする必要があります done:
イベントですが、キューリストでこのファイルのインデックスを取得できません。
何か案は?
回答:
回答№1は2私の質問に関する解決策を見つけました。
jQuery Fileupload
データを返します done
含まれるイベント context
アップロードされたスレッドごとのパラメーター。これはDOM要素に関連し、私の場合の非表示などの操作に使用できます。
$("#fileupload").fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: "assets/plugins/jquery-file-upload/server/php/",
done: function(e, data) {
//hide completed upload element in queue
$(data.context["0"]).fadeOut(700);
//here isoutput of uploaded objects
console.log(data.result);
}
});