Anchor scroll offset

Can we move this function out into a helper function like the others (e.g. `initViewPort`)?