JavaScript drag-and-drop for Prototype, early alpha playground
June 3rd, 2005I’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!
Tweet