gpt4 book ai didi

Plupload 多个实例

转载 作者:行者123 更新时间:2023-12-04 22:50:26 29 4
gpt4 key购买 nike

我正在尝试在页面上设置未知数量的 plupload 实例。我需要动态添加更多实例并删除和重置其中一些。我有一般的想法,但没有任何效果。

我的尝试之一是 jsfiddle .

谢谢大家的帮助。

代码:

var uploaders = new Array();

initUploaders = function(uploaders) {
console.log("initUploaders()");
$(".gallery").each(function() {
var el = $(this);
var button = el.attr("id") + "_uploader";
console.log("Init uploader id:" + el.attr("id"));
var uploader = new plupload.Uploader({
runtimes: 'gears,html5,flash,silverlight,browserplus',
browse_button: button,
max_file_size: '10mb',
url: 'ModuleGallery/Upload/',
flash_swf_url: 'http://static.srv42.net/plupload/js/plupload.flash.swf',
silverlight_xap_url: 'http://static.srv42.net/plupload/js/plupload.silverlight.xap',
filters: [
{
title: "Image files",
extensions: "jpg,gif,png"}
]
});

uploader.bind('FilesAdded', function(up, files) {
uploader.start();
});

uploader.init();
galleryUploaders.push(uploader);
};

initUploaders(uploaders);

最佳答案

最后的答案很简单。您可以正常实例化它并绑定(bind)到 QueueChanged 事件。

uploader.bind('QueueChanged', function (up, files) {
uploader.start();
up.refresh();
});

关于Plupload 多个实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7361434/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com