Added pageYOffset to top position calculation to allow for scroll between flips