

Ask HN: Best JavaScript drag-and-drop plugin? - bgriggs1

We're migrating a Flex app to HTML and are currently considering drag-and-drop.<p>Considerations: obviously we want it to look great, but it also needs to be easy to tie in Ajax calls to drag events.  We'd also like to enable this functionality with multiple UI areas.<p>Has anyone had good success with a particular plugin?  Or is that a hopeless cause and we should just write our own?<p>We're trying to stick with jQuery for our overall framework.<p>We'd like to check on any feedback from HN before diving in.
======
simonw
I've had lots of success with the draggable/droppable modules from jQuery UI.
They cover a lot of tricky cases (don't start dragging unless the mouse has
moved more than a few pixels, revert to original position if the drag fails,
arrange draggables in to "groups" so they only interact with the correct
droppables) and generally do everything I need straight out of the box.

The only problem I've had with them has been advanced code that needs to make
independent modifications to the position of the draggable during the drag,
but a post on their support forum solved that one for me:
[http://forum.jquery.com/topic/trying-to-manipulate-the-
posit...](http://forum.jquery.com/topic/trying-to-manipulate-the-position-of-
a-draggable-mid-drag-doesn-t-seem-to-work)

In the past I've used YUI 2's drag and drop to good effect, but jQuery UI's is
much easier to get started with.

~~~
kineticac
I also like the simplicity of jQuery's modules. Take a look of what else they
have, it's solid.

YUI has some really amazing things as well, but it's a bit bloated with too
many options. You can probably drag and drop something in YUI about 50
different ways, which is neat, but in the end you'll only really need 1.

