什么会导致jquery.fileupload.js中的drop事件不触发?
我注意到,在jquery.fileupload.js中,小部件默认情况下将放置区域指定为整个文档什么会导致jquery.fileupload.js中的drop事件不触发?,jquery,file,upload,blueimp,Jquery,File,Upload,Blueimp,我注意到,在jquery.fileupload.js中,小部件默认情况下将放置区域指定为整个文档 options: { // The drop target element(s), by the default the complete document. // Set to null to disable drag & drop support: dropZone: $(document) } 并且指定的drop zone元素已附加以下事件处理程序 _init
options: {
// The drop target element(s), by the default the complete document.
// Set to null to disable drag & drop support:
dropZone: $(document)
}
并且指定的drop zone元素已附加以下事件处理程序
_initEventHandlers: function () {
if (this._isXHRUpload(this.options)) {
this._on(this.options.dropZone, {
dragover: this._onDragOver,
drop: this._onDrop,
// event.preventDefault() on dragenter is required for IE10+:
dragenter: this._onDragEnter,
// dragleave is not required, but added for completeness:
dragleave: this._onDragLeave
});
this._on(this.options.pasteZone, {
paste: this._onPaste
});
}
我有一个站点,每当文件被放到页面上时,都不会调用drop事件处理程序。dragover事件触发,但不触发drop事件。
问题:
有人知道是什么阻止了投掷事件的发生吗
我应该注意到还有另一个脚本正在设置小部件属性。在该脚本中,只有将文件拖放到文件输入元素时,才会成功调用add回调
$('#fileupload').fileupload({
url: url,
formData: {'_authenticator': $('#_authenticator').val()},
dataType: 'json',
autoUpload: false,
maxChunkSize: parseInt($('#chunksize').attr('data'))
}).on('fileuploadadd', function (e, data) {
// add file event code
}
我不认为这些自定义代码一定会阻止dropzone的事件触发,但我想听听任何人的想法
多谢各位