Wednesday, 15 May 2013

javascript - HTML5 drag and drop not working -



javascript - HTML5 drag and drop not working -

i using html5 drag , drop script , doesn't work. when utilize error console in safari, says :

not_found_err: dom exception 8: effort made reference node in context not exist.

i have no thought means. here example: http://thomaswd.com/maze. seek dragging mouse indicated square. it's supposed create algernon remain @ box. thanks!

also, possible stop user dragging mouse through walls? thanks!!

collision walls http://www.html5rocks.com/en/tutorials/canvas/notearsgame/

as far mouse , error goes, don't see either. error listed above obvs. issue source/script. looked through it, there nil there, did remove js before posting example?\

edit

ev.target.appendchild(document.getelementbyid(data)); line. "error: effort made reference node in context not exist. @ drop (thomaswd.com/maze/:18:15) @ htmldivelement.ondrop (thomaswd.com/maze/:50:225)"

the doms (getelementbyid) looking id "mouse" , can't find it. set image id = "mouse"

i used chromes developer tools , edit line locally , worked. , mouse dropped without issue.

<img src="rat.png" id="mouse" width="60px" ondragstart="drag(event)" style="cursor:move;" draggable="true">

javascript html drag-and-drop

No comments:

Post a Comment