【问题标题】:Blueimp jQuery File Upload - hide file from queue after upload done responceBlueimp jQuery File Upload - 上传完成响应后从队列中隐藏文件
【发布时间】:2014-07-13 21:24:13
【问题描述】:

我正在使用 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:事件的列表中隐藏该文件,但我无法在队列列表中获取该文件的索引。

有什么想法吗?

【问题讨论】:

    标签: javascript jquery jquery-file-upload blueimp


    【解决方案1】:

    找到关于我的问题的解决方案。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-29
      • 1970-01-01
      • 2018-05-18
      • 2020-12-10
      • 2013-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多