use .getComputedStyle() instead of offsetLeft or offsetTop