Roll.js is a tiny javascript library (less than 8kb, no dependencies) to help you keep track of position, scrolling, and pagination.

View demo   View on Github