This is a sample HTML:
Drag Me!
and JavaScript code:
$(function () { var dragImage = document.createElement("img"); dragImage.src = "/image/to/show/when/dragging.jpg"; function handleDragStart(e) { e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setDragImage(dragImage, e.layerX, e.layerY); } $("#draggableObject").get(0).addEventListener('dragstart', handleDragStart, false); });
Native HTML5 Drag and Drop
MDN::dataTransfer