Smooth Site Scrolling?

Good day everyone.

I was wondering how this website was able to achieve their smooth scrolling effect, and if I could achieve said effect in Webflow:

Any help is appreciated.

Sorry for the bump, but I really do require help with this. :slight_smile:

1 Like

Hi @Desiign,

well you could try to reverse-engineer their code to see what function they’ve used but it’s pretty hard to read and understand what’s going on… if you’re into it, try ctrl+f with keyword scroll… maybe you find something interesting in the CSS or JS files:


The scrolling looks nice indeed :slight_smile:
Let us know if you find something, I’d be interested too !

Good luck


Here you go. Example in my portfolio below…

Can’t remember where I found this but it took some digging around when I wanted to know the same thing a couple years ago. I add it to all my builds along with “fastclick.js” to get rid of click delays on browsers - both add a nice little final polish.

The current settings add just a subtle little “hi-jacking” of the default janky/jumpy scrolling behavior of most browsers. Just a touch of smoothness and a tiny bit of overscroll on a quick mouse wheel movement, if you want a different feel then play around with the settings at the top of the script. You can fine tune it quite a bit…

Webflow doesn’t allow you to upload js files so you’ll need to host it elsewhere…

Then just add it as an include in the footer code of your site.

<script type="text/javascript" src="https://yourhostingservice/smoothscroll.js"></script>




I’m struggling with this and would love any help you could offer.

  1. I’m not seeing the smooth scrolling on your portfolio you linked above, but I do see the smooth scrolling here

I’m trying to recreate it with your tutorial, but am really struggling - here is my share link for the project I’m trying to get it working on

Thank you in advance!

Same thing here
Im on trackpad scroll.

Try using this

  if (window.addEventListener) window.addEventListener('DOMMouseScroll', wheel, false);
window.onmousewheel = document.onmousewheel = wheel;

function wheel(event) {
    var delta = 0;
    if (event.wheelDelta) delta = event.wheelDelta / 40; //controls the scroll wheel range/speed
    else if (event.detail) delta = -event.detail / 40;

    if (event.preventDefault) event.preventDefault();
    event.returnValue = false;

var goUp = true;
var end = null;
var interval = null;

function handle(delta) {
var animationInterval = 20; //controls the scroll animation after scroll is done
  var scrollSpeed = 20; //controls the scroll animation after scroll is done

if (end == null) {
  end = $(window).scrollTop();
  end -= 20 * delta;
  goUp = delta > 0;

  if (interval == null) {
    interval = setInterval(function () {
      var scrollTop = $(window).scrollTop();
      var step = Math.round((end - scrollTop) / scrollSpeed);
      if (scrollTop <= 0 || 
          scrollTop >= $(window).prop("scrollHeight") - $(window).height() ||
          goUp && step > -1 || 
          !goUp && step < 1 ) {
        interval = null;
        end = null;
      $(window).scrollTop(scrollTop + step );
    }, animationInterval);

Not so smooth, but works for now :smile: I’m trying to find a smoother solution.

Piter :webflow_heart:


Oh, it look super nice on Oui Will website. I find something similar on
It would be nice if someone figure out how we can incorporate this smoothness in our design.

Has anyone found the input for this - I have been requested this effect in one of my projects.

Many thanks!

Did you ever find a smoother solution? I’d be very grateful if possible.

1 Like

Nope :sweat_smile: but if I find a solution I will share it :blush:

1 Like

Hey guys,

I recently found this, it seems to have support for mousewheel easing and distance control.

Haven’t the foggiest idea how to implement it thought - I have a design brain unfortunately. Anyone come across this before and have dev. skills?

Wow, I didn’t realize this was a feature that many others would be interested in. Unfortunately I am yet to find a solution, so if anyone has any way that we can emulate this in a Webflow site please do share it with us.

Perhaps we should request this on the wishlist?

I personally find forced smooth scrolling on sites off-putting, especially considering that all major browsers already have smooth-scrolling on by default and landing on the page that kinda-but-not-quite behaves like you used to is jarring. The example from the OP feels horribly laggy to me for example.

Another consideration is that most of the scrolljacking techniques will produce slightly different results on different browsers to the point of it being unusable on one while good enough on another. not sure if pains of trying to normalize their behaviour worth it.

Just my 2 cents.

@dram To a certain extent, I agree with you. Especially on the part of it looking good on some browsers whereas on others it can look really wonky. But sometimes a client might just want this effect, or perhaps it fits the project, so I think in some cases it can be really effective.

Anyway, I found this from Stackoverflow, but I just can’t seem to figure out how to properly implement it:

Edit: I got the code to work! Add this to the Custom Code section on your site before the Body tag:

<body onload="init()">
function init(){
    new SmoothScroll(document,400,50)

function SmoothScroll(target, speed, smooth) {
    if (target == document)
	    target = (document.documentElement || document.body.parentNode || document.body) // 
cross browser support for document scrolling
    var moving = false
    var pos = target.scrollTop
    target.addEventListener('mousewheel', scrolled, false)
    target.addEventListener('DOMMouseScroll', scrolled, false)

    function scrolled(e) {
	    e.preventDefault(); // disable default scrolling

	    var delta = normalizeWheelDelta(e)

	    pos += -delta * speed
	    pos = Math.max(0, Math.min(pos, target.scrollHeight - target.clientHeight)) // limit scrolling

	    if (!moving) update()

    function normalizeWheelDelta(e){
			    return e.wheelDelta/e.detail/40 * (e.detail>0 ? 1 : -1) // Opera
			    return -e.detail/3 // Firefox
		    return e.wheelDelta/500 // IE,Safari,Chrome

    function update() {
	    moving = true
	    var delta = (pos - target.scrollTop) / smooth
	    target.scrollTop += delta
	    if (Math.abs(delta) > 0.5)
		    moving = false

    var requestFrame = function() { // requestAnimationFrame cross browser
	    return (
		    window.requestAnimationFrame ||
		    window.webkitRequestAnimationFrame ||
		    window.mozRequestAnimationFrame ||
		    window.oRequestAnimationFrame ||
		    window.msRequestAnimationFrame ||
		    function(func) {
			    window.setTimeout(func, 1000 / 50);

Just tweak the values to your liking and you should be good to go!

1 Like

Hello again :grin:

I’ve made something smoother :smile: The scrollbar is fancy too, but I can’t understand how to style the scrollbar here. I have some sites with styled bar, but here is different.

I’m using >

The solution for a smoother scroll is renderByPixels: false;

Here’s is the project where you can explore and clone if you like >

Piter :webflow_heart:


Hi All,

I made a Webflow site awhile ago showcasing the 4 most common implementations for momentum/inertia scrolling:


Clone Link:
Clone URL


Thanks a lot for sharing!

1 Like

Hey guys,

I’ve tried multiple times to get the smooth site scrolling functioning on my site using the Vanilla.js, SmoothScrolling and Luxy custom code to no avail.

Anyway someone could post a step by step to get one of them running?

Much appreciated guys!

1 Like

Hello @tjthomsonjones

If you want to use the vanilla.js method you need to do the following:

1. Add a div with a class > main > this will be your sections wrapper

2. Add your sections inside > main > sections inside

3. Add the script before the closing body tag

// First we get the elements we need, the body and our container on which
// we are going to apply a smooth scroll. You will always need a container
// to apply a smooth scroll. You will not be able to apply it directly to
// the body.
const body = document.body;
const main = document.querySelector('main');

// We define variables we will need later. 
// 2 variables to store the scroll position and 2 variables to store the 
// container position.
let sx = 0;
let sy = 0;

let dx = sx;
let dy = sy;

// The trick is to set a height to the body to keep the browser scroll bar. = main.clientHeight + 'px';

// Then we fix our container so it won't move when the user scrolls.
// We will move it ourself with the Linear Interpolation and translations. = 'fixed'; = 0; = 0;

// We bind a scroll event to the window to watch scroll position.
window.addEventListener('scroll', scroll);

function scroll() {
  // We only update the scroll position variables
  sx = window.pageXOffset;
  sy = window.pageYOffset;

// Then we start a `requestAnimationFrame` loop. 


function render() {
  // We calculate our container position by using our Linear Interpolation method.
  dx = lerp(dx, sx, 0.1);
  dy = lerp(dy, sy, 0.1);
  dx = Math.floor(dx * 100) / 100;
  dy = Math.floor(dy * 100) / 100;
  // Finally we translate our container to its new positions.
  // Don't forget to add a minus sign because the container needs to move in 
  // the opposite direction of the window scroll. = `translate(-${dx}px, -${dy}px)`;
  // And we loop again.

// This is our Linear Interpolation method.
function lerp(a, b, n) {
  return (1 - n) * a + n * b;


1. Add a div with a class > main > this will be your sections wrapper > the main div needs an ID > luxy

2. Add your sections inside > main > sections inside

3. Add the script before the closing body tag

<script src=""></script>

<script charset="utf-8">
			wrapper: '#luxy',
			wrapperSpeed:  0.06


Hope this helps!

Piter :webflow_heart: