When you drag an image , there is a semi-transparent ghost image that follow your mouse when you hold it down.
Is there some way to apply CSS/JS to remoe this effect on a certain portion?
The easiest way is to set very large x
and y
coordinates to setDragImage
to its away from the screen. For example:
element.addEventListener('dragstart', function(event) {
event.dataTransfer.setDragImage(element, -99999, -99999);
}, false);
The actual element you pass to setDragImage
doesn't really matter. We use the same element here for convenience.