I am trying to implement something similar to a recycle bin in which you can remove items from a list. These elements <li>have some elements inside (divs, span, etc.). Drag and drop itself works great. But the image with the dragged item does not display its contents in Webkit browsers.
My list item has a background color border. In Firefox, an image is an entire element. In Webkit browsers, only a draggable item with no content. I see the background and border, but without the text inside.
I tried to make a copy of the element and make it be an image, but it does not work.
var dt = ev.originalEvent.dataTransfer;
dt.setDragImage( $(ev.target).clone()[0], 0, 0);
I have a simplified example demonstrating the same behavior: http://jsfiddle.net/ksnJf/1/
source
share