问题:试图模拟使用角拖放列表(转到详细描述)的前端拖放。
Tried :
1.jquery-模拟:给出以下错误
Uncaught :未能对‘EventTarget’执行'dispatchEvent‘:参数1不是’EventTarget‘类型。
2.拖放-helper.js:单击要拖动的项目
3.drag_to :什么都没发生
需要更多的建议.
谢谢
jquery:https://github.com/jquery/jquery-simulate
对不起,无法发布drag_to和拖放-helper.js的链接。
发布于 2017-04-18 07:06:03
需要这样调整的自定义事件:
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent", {"cancelable": true})
event.initCustomEvent(type, true, true, null);
event.dataTransfer = {
data: {
},
setData: function(type,val) {
this.data[type] = val
this.types[0] = type
}
getData: function(type) {
return this.data[type]
},
dropEffect: 'move',
effectAllowed:'move',
types: [],
items: {},
files:{}
}
return event
}在本地js拖放脚本中,然后它工作得很好
https://stackoverflow.com/questions/43109946
复制相似问题