plupload 多个 drop_elements
我在一个页面上使用 Plupload,该页面将有多个 drop_elements 以及浏览按钮。我的问题是,默认情况下,使用 plupload 您可以为 drop_element 和 browser_button 定义一个元素,根据我阅读和尝试的内容,它只接受 1 个元素,而该元素恰好是该元素的 ID。
我需要以某种方式扩展它,以便我可以定义一个 id 数组或将其更改为类而不是 id。
var uploader = new plupload.Uploader({
runtimes : 'gears,html5,flash,silverlight,browserplus',
browse_button : **['ele_id1', 'ele_id2']**,
drop_element : **['dropzone_id1', 'dropzone_id2']**,
max_file_size : '200mb',
url: '//senditfrom.me/fileupload/upload/do_upload',
flash_swf_url: '//senditfrom.me/fileupload/js/plupload.flash.swf',
silverlight_xap_url: '//senditfrom.me/fileupload/js/plupload.silverlight.xap',
resize : {width : 320, height : 240, quality : 90}
});
这可能吗?有没有人找到一种方法可以只定义 1 个元素?
I am using Plupload on a page that will have multiple drop_elements as well as browse buttons. My question is, by default with plupload you can define an element for both the drop_element and browse_button, from what i've read and tried it only accepts 1 element which happens to be an ID of that element.
I am needing to somehow extend this, so that I can define an array of id's or change it to be a class instead of an id.
var uploader = new plupload.Uploader({
runtimes : 'gears,html5,flash,silverlight,browserplus',
browse_button : **['ele_id1', 'ele_id2']**,
drop_element : **['dropzone_id1', 'dropzone_id2']**,
max_file_size : '200mb',
url: '//senditfrom.me/fileupload/upload/do_upload',
flash_swf_url: '//senditfrom.me/fileupload/js/plupload.flash.swf',
silverlight_xap_url: '//senditfrom.me/fileupload/js/plupload.silverlight.xap',
resize : {width : 320, height : 240, quality : 90}
});
Is this possible? has anyone found a way around just being able to have 1 element defined?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道这是一个老问题,但我遇到了有 2 个 browser_buttons 的问题,并找到了解决它的方法,我想在这里分享。
HTML:
JS:
有关详细信息,请参阅下面的 jsfiddle。
http://jsfiddle.net/wLMNB/
I know this is an old question but I came across the problem of having 2 browse_buttons and found a way to solve it which I'd like to share here.
HTML:
JS:
See the below jsfiddle for details.
http://jsfiddle.net/wLMNB/
我不确定自 David Healey 发布他的答案以来该插件是否已更改,但我发现他的答案只需稍加修改即可工作。
他的部分:
应该改为:
很快就可以了!
I'm not sure if the plugin has changed since David Healey posted his answer but I found that his answer works with a small modification.
His section:
Should be changed to:
And presto it works!
你可能需要破解该插件。在插件中,他们使用了 getElementById(browse_button) 您可以尝试将其更改为使用类。我还没有尝试过,但它可能会起作用。
you may have to hack the plugin. in plugin they have used getElementById(browse_button) you can try changing it to use class instead. i have not tried this but it may work.