How do I make it so that there is no "Ghost" when I drag an image in Firefox?

TIMEX picture TIMEX · Dec 3, 2009 · Viewed 8.8k times · Source

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?

Answer

jviotti picture jviotti · Feb 26, 2016

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.