簡體   English   中英

Blueimp jQuery File Upload-上傳完成后,從隊列中隱藏文件

[英]Blueimp jQuery File Upload - hide file from queue after upload done responce

我正在使用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
    }
});

上傳完一個文件后,我需要在done:事件的列表中隱藏該文件,但無法在隊列列表中獲取該文件的索引。

有任何想法嗎?

找到了關於我的問題的解決方案。

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);
    }
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM