javascript to help find correct coordinates for css position:relative / position:absolute ~