Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of the script.aculo.us user interface JavaScript library, a member of the Prototype core team and a Ruby on Rails core alumnus.
You're using my JavaScript work every day, even if you're not aware of it!
@thomasfuchs on Twitter    Need consulting, corporate training or want me to speak at your conference? Contact me!

JavaScript drag-and-drop for Prototype, early alpha playground

June 3rd, 2005

I’ve put up a working demo and JavaScript code for drag-and-drop with nice usage of the Effects2 package.

To make an element draggable, just use:


  new Draggable('id_of_element');

To mark it as a drop target:


  Droppables.add('id_of_element');

Of course it’s early alpha and lacks refactoring and a polished API, but it works. Tested in Safari in Firefox.

UPDATE: I’ve updated the demo page above, and also added a second demo page on sortable floats and lists

Have fun!