Cross-browser drag-and-drop

This little JavaScript implements drag-and-drop of HTML elements, with collision detection and arbitrary constraining boxes. It works in IE6/Win, IE5.5/Win, Gecko-based browsers (Firefox), Safari, Opera, and IE5/Mac. It does not use browser sniffing — where the browsers differ, the script simply checks for the existence of the appropriate DOM features. Dragged elements can be relatively or absolutely positioned.

A nice example of the power of constrained dragging can be see in lists.

Care to do some dragging?

Valid XHTML 1.1!