Content Creation
If there’s one thing I’ve learned from endÂless hours of scrolling — codÂing, readÂing docs, or just bingÂing YouTube — it’s the valÂue of smooth scrolling.
It’s a game-changer.
Today, I’m divÂing deep into how you can achieve that butÂtery smooth scroll on Mac and WinÂdows. And if you run a webÂsite or blog, stick around. I’ve got some tips to make your site a pleasÂant place to scroll through.
Ever notice how some scrolling feels like glidÂing on ice while othÂers more like hopÂping on rocks? That’s the difÂferÂence smooth scrolling makes. It transÂforms your scrolling expeÂriÂence from frusÂtratÂing to fluÂid. Just picÂture a side-by-side comÂparÂiÂson: on one side, you’ve got that janky, stutÂterÂing scroll. On the othÂer, smooth as silk. That’s what we’re aimÂing for.
For those rockÂing a LogÂitech mouse or touchÂpad, you’re halfway there. Logitech’s Logi Options+ softÂware is your tickÂet to smooth scrolling bliss. It’s pretÂty straightforward:
Just like that, you’re set.
Now, let me introÂduce you to the MVP: SmoothScroll.
Here is why I love SmoothScroll:
Just rememÂber, if you’ve got Logi Options+ rolling, turn off its smooth scrolling. They tend to clash.
Here’s the cherÂry on top.
MakÂing sure your webÂsite or blog offers smooth scrolling can seriÂousÂly upgrade your visitor’s experience.
Here’s how:
scroll-smooth
to your html
class if you’re using TailÂwind CSS.Before you go too far down the rabÂbit hole of JavaScript-based smooth scrolling, know that there is a native CSS feaÂture for this: scroll-behavior.
html {
scroll-behavior: smooth;
}
And before you reach for a library like jQuery to help, there is also a native JavaScript verÂsion of smooth scrolling, like this:
// Scroll to specific values
// scrollTo is the same
window.scroll({
top: 2500,
left: 0,
behavior: 'smooth'
});
// Scroll certain amounts from current position
window.scrollBy({
top: 100, // could be negative value
left: 0,
behavior: 'smooth'
});
// Scroll to a certain element
document.querySelector('.hello').scrollIntoView({
behavior: 'smooth'
});
CredÂits: Christ CoyÂer | CSS Tricks
P.S. If you preÂfer videos, make sure to check out My YouTube Channel
Selvin Ortizđź‘‹
I'm a software engineer and content creator.
I help brands develop software and content strategies 🚀
On this blog, I write about software development, emerging technology, technical leadership, and content creation ✨
Content Creation
Tech Tips
Tech Reviews
Get the latest updates on my work, articles, and other interesting news about generative AI delivered right to your inbox twice a month. No spam, guaranteed 🙌