How does Trello snap tasks into place so nicely?

We are working on an app right now and would like to be able to drag elements on the screen, then drop them, and have them snap into place. Trello does this really nicely, so we were wondering if ya'll know how they did that. I'm assuming this is done with JavaScript, but we were wondering if the Trello community had some insight on the matter.