Joe
Joe

Reputation: 659

Drag and drop on Javascript

I implemented drag and drop here. Try clicking on the ball and dragging it around.

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

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

I would like the listener to be attached to the ball so I can attach listeners to multiple balls. Is this possible? Thanks,

Upvotes: 4

Views: 393

Answers (1)

martriay
martriay

Reputation: 5742

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

Upvotes: 1

Related Questions