Javascript drag and drop

I implemented drag and drop here. Try to click on the ball and drag it.

http://joelin.org/p/mouse2.html

However, I used the html element as one that catches mouse events. If I use the ball element to catch events, my mouse pointer quickly leaves the ball if the mouse pointer moves too fast.

I would like the listener to attach to the ball so that I can attach the listeners to several balls. Is it possible? Thanks,

+4
source share
1 answer

Have you tried jQuery Draggable? http://jqueryui.com/draggable/

+1
source

All Articles