This also doesn't work as expect in the following case:
element is absolutely positioned, but no top / left value is set.
Before setOffset, the element is positioned as if it was positioned static. This screws up setOffset because curTop and curLeft are 0, but curOffset is something like: {top: 300, left: 0}.
I recommend if elem does not have a left or top set, it doesn't try to adjust.