Use getBoundingClientRect to do DOM measurements.

offsetLeft and offsetTop don't take parents' offsets into account.