See #58: Made the marginTop option allow for a function so it can be used to dock to something other than the top of the window.  Kept the original offsets so they can be restored when the element is restored.  Updated the demo page and docs.