javascript - Drag and drop with jQuery and Raphael.js -
hi i'm working on following project: http://seegermattijs.be/smart_open_path.html want alert box when red circle gets dropped on yellow square.
i used following code:
$('.ui-draggable').draggable({}); $( "#droppable" ).droppable({ drop: function() { alert( "dropped" ); } }); as can see nothing @ all.
can me out? thanks!
the example posted work me, maybe not in way intended work.
drag & drop cares mouse position when button goes down (to start it) , when goes after (to end it). position of element started drag (the red circle in case) not matter. may comment out contents of drag function , trigger alert long click on red circle, move cursor yellow square , release mouse.
if want alert when circle touch square, need check if circle touching square when drag stop, , fire alert. may add code stop function in code , should work.
you may check jsbin possible way it.
Comments
Post a Comment