Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of Zepto.js, of script.aculo.us, and I'm a Ruby on Rails core alumnus. With Amy Hoy I'm building cheerful software, like Freckle Time Tracking and Every Time Zone and write books like Retinafy.me.
   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!