Sign in
Log inSign up
How to do smooth scrolling without jQuery?

How to do smooth scrolling without jQuery?

Stephan de Vries's photo
Stephan de Vries
·Mar 17, 2016

In the past when I wanted to have smooth scrolling on a website I'd just use this jQuery snippet by CSS-Tricks. It does exactly what I want and didn't require any javascript library (except jQuery).

These days I prefer to avoid using big libraries like jQuery too much, because I only use 5% of the functionalities while getting worse load times. Causing me to look for a vanilla JS version of the jQuery snippet provided by CSS-Tricks.

Is there an elegant way of implementing smooth scrolling by using vanilla JS?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct