Scroll Sneak (graffiti image)
Normally, when you scroll down a web page and click on a link, your browser will jump back to the top when it loads the new page. However, if you click on a tab or nav arrow below, even though a new page is loaded, the scroll bar position will remain the same. This magic is performed by the dapper, old-timey script “Scroll Sneak”, which works like this:
- click on a link below and the position of the scroll bars is stored in a string in the window.name object
- a new page loads and the window.name object is checked for a prior scroll position—if one is found, the page is scrolled to that point
Get a full explanation in the blog post Scroll Sneak: maintaining scroll position between page loads.
*Thank you to Homestar Runner for bringing joy to the internet and not asking me to remove my
picture of the Sneak.