Skip to content
All posts

How to Add Smooth Scroll in a Wix Website

1 February 2025 · 2 min read

Adding smooth scrolling to your Wix website enhances user experience by creating a fluid and polished transition between scroll actions.

In this guide, we will implement smooth scrolling using

Lenis

, a lightweight JavaScript library for smooth page scrolling.

Requirements

Wix Premium Plan

(Custom code functionality is only available in premium plans).

Smooth Scroll in a Wix Website Guide

Step 1: Adding the Custom Code

To enable smooth scrolling, we will use

Lenis.js

. Below is the custom code you need to add to your Wix website:

<script src="https://unpkg.com/@studio-freight/lenis@1.0.42/dist/lenis.min.js"></script>

<style>

/* Ensure the page height is correctly set for Lenis */

html.lenis, html.lenis body {

height: auto;

/* Override default scroll behavior */

.lenis.lenis-smooth {

scroll-behavior: auto !important;

/* Prevent scrolling when necessary */

.lenis.lenis-stopped {

overflow: hidden;

</style>

<script>

// Initialize Lenis with smooth scrolling configuration

const lenis = new Lenis({

lerp: 0.1, // Damping effect for smoothness

wheelMultiplier: 0.7, // Adjust scroll speed

gestureOrientation: 'vertical', // Enable vertical scrolling

normalizeWheel: false, // Preserve native wheel behavior

smoothTouch: false // Disable smooth scrolling for touch devices

});

// Animation frame loop to keep Lenis active

function raf(time) {

lenis.raf(time);

requestAnimationFrame(raf);

requestAnimationFrame(raf);

</script>

Step 2: Implementing the Code in Wix Studio

Follow these steps to add the custom code to your Wix website:

Go to your Wix Studio dashboard

On the bottom-left, click

Settings

Settings

, search or scroll down to find

Custom Code

Click

Add Custom Code

In the pop-up panel:

Paste the custom code in the

"Paste the code snippet here:"

box.

Give it a recognizable name like

"Smooth Scroll"

Apply the code to

all pages

Set the placement to

Head

Click

Apply

Step 3: Testing the Smooth Scroll Effect

Refresh your

published

website to activate the smooth scrolling effect.

Scroll up and down to experience the

fluid transition

If you want to

adjust the smoothness

, modify the lerp and wheelMultiplier values in the script.

Credits

Lenis.js

developed by

Studio Freight

Conclusion

Adding

smooth scrolling to a Wix website

significantly improves the user experience, giving it a professional touch. Following this guide, you can effortlessly integrate

Lenis.js

and achieve a seamless scrolling effect on your Wix site.

It is a small polish detail, and exactly the kind of thing our

Motion & Interaction Design service

builds into client sites by default.

Filed under

Wix Studio

More Blogs

All Blogs

Read post

10 Jan 2026

Smart Animated Counters in Wix Studio

Learn how to add smart animated number counters to your Wix Studio site. This step-by-step guide provides a copy-and-paste Velo code snippet that automatically handles complex formats, such as 10k, $500, or 98% satisfaction.

Read post

29 Jan 2025

Smooth Wix Studio Preloader Animation

Learn how to add a smooth page loading animation in Wix Studio using a preloader, custom code, and loop videos for a seamless transition.

Read post

27 Oct 2026

Shoal Shopify Theme Documentation

Everything you need to set up and customize Shoal, our Shopify theme: setup steps, every section and block, an FAQ and how to get support.