Is there a way to control the look of โwhat you dragโ using HTML5 drag and drop APIs?
Usually any HTML element is draggable, which becomes translucent and follows your cursor until you stop / fall. I would like to control this so that I can start dragging from anywhere inside the element, but when you actually start dragging, I can only have a small image, following the cursor exactly where the cursor is.
A practical example: a list of things to drag and drop, each of which is a small image and some text for the name of the thing that you will drag to the side. I would like to be able to start dragging anywhere in the element above the image or text, but then only the image follows your cursor and directly below the cursor, and not offset from where you dragged it.
I can come up with several ways to trick it (a hidden element that appears where you hover when you start to drag, and thatโs what you actually drag), or resort to the classic Javascript drag and drop.
thank
html html5 drag-and-drop draggable appearance
Chris Simpson Jun 11 '13 at 22:41 2013-06-11 22:41
source share