active page should be the 1st one whos bottom clear the top, not the last one that whos top clears the bottom. this way if multiple pages are visible, and you click to goto page x, we can scroll it to the top Y=0, and it is then considered active (otherwise x+1 would be active, which is the subsequent page at the bottom)