Consider using one of the infinite scroll jQuery libraries and pull the data as needed. Instead of writing the code yourself, that library can handle the scrolls and so on. Mostly what happens is that events are triggered — computers are accurate in calculations, and users might scroll at different speeds. These libraries can help in pulling data sequentially as needed.
One of such libraries:
Infinite Scroll[
^]