adjust viewport height when page count changes.