Completed helper function called togglePosition of css coordinates