Improved search for page index when scrolling.