Hi @PapaDeBeau. Are you talking about with ScrollSmoother in particular? Or a non-ScrollSmoother-controlled page?
It'd definitely increase your chances of getting a solid answer quickly if you provide a super minimal demo showing just a basic idea of what you want to do (even if it's not functional). And are you trying to navigate to an anchor onclick or when the page loads?
ScrollSmoother has a very easy way to animate to a particular element:
https://greensock.com/docs/v3/Plugins/ScrollSmoother/scrollTo()
And if want to do that onload, @Cassie already had that in her demo. You could do:
window.addEventListener("load", () => {
let urlHash = window.location.href.split("#")[1],
scrollElem = document.querySelector("#" + urlHash);
if (scrollElem) {
// if you've got a ScrollSmoother instance...
smoother.scrollTo(scrollElem);
// otherwise...
gsap.to(window, { scrollTo: scrollElem }); // don't forget to load/register ScrollToPlugin
}
});
Does that help?