Member-only story

Smooth scroll to a section in your Medium article

Nikhil Nanjappa
3 min readJul 3, 2018

--

For one of my recent Medium articles, I wanted a simple Table of Contents that could scroll a reader to a particular section of my article. When I was researching for a previous implementation of such a feature in Medium, I came across couple of good articles on How to link to a specific paragraph in your Medium article (2018 Table of Contents method) and How to easily create a table of contents for your Medium article. The articles were no doubt insightful but they were not exactly what I was looking for, a smooth scroll(without reload) rather than a link to a section of an article which reloads the page. Nonetheless, those articles gave me a very good stepping stone on how to achieve what I wanted & hence this article. So shout-outs & thanks to Quincy Larson and Adam Kelly.

The thing with the above articles were that they had links that reloaded the page and then moved to a particular section in the same article rather than smooth scroll to a section(without reloading the page) due to the full(absolute) paths. Since front-end development is one of my fortes, I’m very keen on the UI aspects of a page. Which is why, the reload jump feature did the trick but not the way I wanted.

So, how do you do it ?

By creating anchor links. The first part is the same as one of the above articles, viz.-

--

--

Nikhil Nanjappa
Nikhil Nanjappa

Written by Nikhil Nanjappa

Experienced Full-Stack Developer who loves sharing knowledge. Gaming & Music addict. Always grateful and looking for new experiences in life.

Responses (6)