Drawing Tool

Drag and Drop

Step 13: Allow elements to be dragged over the canvas.
Hint: Use a dragover event listener:
yourCanvasVariable.addEventListener(`dragover`, dragOver);

function dragOver(event) {
  // the default browser action is to disallow elements from being dragged over
  // this prevents the default browser action from happening
  event.preventDefault()
}
Last step Next step