我有一个按钮和一个拖放区域。我想将值文件上传器应用于此按钮。但是希望将拖放区域保留为除此之外的另一个框。我如何实现它?我目前的实现如下:
that.imageUploader = new qq.FileUploaderBasic({
button: $('#sprPictureUpload')[0],
action: '/ui/rest/utils/upload/image/file',
allowedExtensions:SUPPORTED_IMAGE_TYPES,
forceMultipart: true,
multiple: config.multiple,
inputName: 'photoFile',
onSubmit: function(id, fileName) {
renderImagePlaceHolders.call(that, id, fileName);
},
});
html 如下所示:
<section class="upload-section" data-section="upload">
<div class="upload-area">
<div style="">
<h3 style="color:#aaa">
Drag images here
</h3>
<h5 style="color:#aaa"> or if you prefer ...</h5>
<a id="sprGenericPictureUpload" class="btn btn-primary">
<i class="icon-upload icon-white"></i> Choose image to Upload
</a>
</div>
</div>
</section>
所以我想要的是单击#sprPictureUpload
并拖动该.upload-area
部分中的任何位置应该启动照片上传。还有一种方法可以将上传器应用于具有相同配置的两个不同元素吗?