Anchor scroll offset

Those two `simulate` functions don't do the same. Can we inline this function, as it is only used in one place?