I suggest it is the length of one page is making the browser vertical scrollbar appear, hence the shift.
Make the browser viewport smaller and both will have the scrollbar so you will not see the shift.
To avoid it being so obvious, you could add a transition effect of force both pages to be the same length.

Acorn