Adds method to keep track on document scroll position.