Drag and drop is a very cool feature in the browsers too, if really needed. Most JS libraries has this functionality, from jQuery to MooTools. But how they do it?
Well, it's not black magic, actually really simple.
You need to combine two different mouse events: mouseDown and mouseMove, then track the mouse position, update an elements position, finally cancel the mouseMove event on mouseUp.
Create a freely movable window that you can move with a handle.
Click "read more" to see the codes.