I am trying to create a dragEvent and fire it programmatically using this code on Chrome:
var ev = document.createEvent("MouseEvents");
ev.initEvent("dragstart");
and then fire it this way:
element.dispatchEvent(ev);
The element has draggable attribute.
The event was dispatched successfully. However on the event being fired - the dataTransfer object is null. Even when I try to set it manually to a working dataTransfer object - it still stays null.
Any ideas?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…