triggering mouse events var fireMouseEvent = function (type, elem, centerX, centerY var evt = document.createEvent('MouseEvents'); evt.initMouseEvent(type, true, true, window, 1, 1, 1, centerX elem.dispatchEvent(evt); }; var elemDrag = document.querySelector(selectorDrag); var elemDrop = document.querySelector(selectorDrop); if (!elemDrag || !elemDrop) return false; var pos = elemDrag.getBoundingClientRect(); var center1X = Math.floor((pos.left + pos.right) / 2); ・ ・ ・