``pageCoords`` needs to be adjusted for the menu bar height. Also, instead of checking ``pageCoords.bottom`` when finding previous, we should check for ``pageCoords.top``.