Common Pitfalls with the HTML5 Drag ‘n’ Drop API
Alexander Adam
282

Hi, I’m working on DnD API for the last few weeks and I’ve got one simple question : if you want to create your own simple draggable element (so no an element or image that you pass to setDragImage), how can you go over the zIndex problem?

I want to be able to do some animation to the element being dragged regarding if a dropZone is hovered or whatever, and this is only possible by hidding the dragImage (I set an image with opacity 0) and creating my own element that will be placed below the mouse.

But when I do that, it seems that it brokes the dropZone by not firing any event when hovered (this is where the zIndex comes in). How yo bypass this very frustating situation? ☺

If you have any idea, I’d love to hear them!