Content Creation
Selvin Ortiz
If there's one thing I've learned from endless hours of scrolling—coding, reading docs, or just binging YouTube—it's the value of smooth scrolling.
It's a game-changer.
Today, I'm diving deep into how you can achieve that buttery smooth scroll on Mac and Windows. And if you run a website or blog, stick around. I've got some tips to make your site a pleasant place to scroll through.
Ever notice how some scrolling feels like gliding on ice while others more like hopping on rocks? That's the difference smooth scrolling makes. It transforms your scrolling experience from frustrating to fluid. Just picture a side-by-side comparison: on one side, you've got that janky, stuttering scroll. On the other, smooth as silk. That's what we're aiming for.
For those rocking a Logitech mouse or touchpad, you're halfway there. Logitech's Logi Options+ software is your ticket to smooth scrolling bliss. It's pretty straightforward:
Just like that, you're set.
Now, let me introduce you to the MVP: SmoothScroll.
Here is why I love SmoothScroll:
Just remember, if you've got Logi Options+ rolling, turn off its smooth scrolling. They tend to clash.
Here's the cherry on top.
Making sure your website or blog offers smooth scrolling can seriously upgrade your visitor's experience.
Here's how:
scroll-smooth
to your html
class if you're using Tailwind CSS.Before you go too far down the rabbit hole of JavaScript-based smooth scrolling, know that there is a native CSS feature 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 version 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'
});
Credits: Christ Coyer | CSS Tricks
P.S. If you prefer 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 Reviews
Professional Career
Cybersecurity
Web Development
Finances