Streaming live at 10am (PST)

Maintain window scroll position when link clicked with ScrollSneak JS

Here is my read-only link.

Hello,

On the Interview Guide pages, I’m trying to maintain the scroll position of the window when you click between each step, so that the person doesn’t have to scroll back down to the content. If it’s possible, I’d like to do this with code since adding an anchor link to the top of the right-content-container is still jerky and not an entirely smooth experience.

I tried adding in the full code of the function before linking it through <script src="https://mrcoles.com/media/js/scroll-sneak.js"></script> but neither worked. I also tried pasting in the code to the entire project’s custom code section versus on each page of the interview guide but that didn’t work either.

I do have a similar functioning carousel on the bottom of the home page that shows/hides content based on interactions but that wouldn’t work in this case because I need to be able to link to each piece of content. The only other solution would be to have content display dynamically through specific URL parameters but I’d like to try and make this solution work before going back and rebuilding that part of the site to function with URL parameters.

Here is the link to the ScrollSneak.

Thanks in advance!

@emary Have you solved it?

@Matthias no, not yet!