javascript - Dragging element obscures drop target -


i'm using native html5 drag , drop api drag elements on page. problem i'm having dragged element rather large , it's current position obscures of drop targets. when set dragged element display none or visibility hidden or pointer events none, or position absolute , left -10000px dragend event triggered on element.

is there way overcome it?

did try create temporary element behave shadow?

function drag(ev) {     var shadow = createshadowelement();     var element = document.getelementbyid(ev.target.id);     element.appendchild(shadow);      ev.datatransfer.setdragimage(shadow, 0, 0);     ev.datatransfer.setdata("text", ev.target.id); }  function drop(ev) {     ev.preventdefault();     var data = ev.datatransfer.getdata("text");     var element = document.getelementbyid(data);     ev.target.appendchild(element); }  function dragend(ev) {     removeshadowelement();     } 

see @ http://jsfiddle.net/89gs21jj/1/


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -