We can all easily google and find all sort of different methods/codes to get the smooth scrolling to hashtags; either allow you to smooth scroll to the hashtag when you click on the link from another page (click href=”/some-page/#jumphere”) or they allow you to smooth scroll on the same page (click href=”#jumphere”)
However, what if you need both?
You cant do both together; and if you do, either the two sets of codes will contradict each other; or the window will make a split second jump to #jumphere the very moment you click the href=”/some-page/#jumphere”, before jumping back to the original position to scroll to the #jumphere again ( which also means its jerky.)
After spending a few hours trying to figure out a way, I have finally found the way to do both.
First you have this code (just above