How can I run jInvertScroll.js at Webflow to achieve horizontal scroll and parallax effects?

Published on
September 22, 2023

To run the jInvertScroll.js library in Webflow and achieve horizontal scroll and parallax effects, you can follow these steps:

  1. Create a new project in Webflow or open an existing project.

  2. Open the Designer by clicking on the "Design" button.

  3. Navigate to the "Custom Code" tab in the Designer's left sidebar. This is where you can add custom code to your project.

  4. In the "Head Code" section, add the following code snippet to include the jInvertScroll.js library:

<script src="https://cdn.jsdelivr.net/jquery.jinvertscroll/1.0.0/jquery.jinvertscroll.min.js"></script>

This code will import the necessary library for the horizontal scroll and parallax effects.

  1. Next, you need to add some custom code to initialize and configure jInvertScroll.js. Place the following code snippet in the "Footer Code" section:
<script>  $(document).ready(function() {    $('body').jinvertScroll({      width: 'auto', // Set the width to adjust to the content      height: 'auto', // Set the height to adjust to the content      onScroll: function(percent) {        // You can add custom code here to control parallax effects based on scroll position      }    });  });</script>

This code sets up and initializes jInvertScroll.js on the body element. The onScroll function allows you to add custom code to control parallax effects based on the scroll position.

  1. Save your changes in the Designer and publish your Webflow project to ensure the custom code is implemented on your live site.

With these steps, you have successfully integrated the jInvertScroll.js library into your Webflow project to achieve horizontal scroll and parallax effects. Experiment with the onScroll function to customize the parallax effects based on your requirements.

Additional Questions:

  1. How can I add horizontal scroll and parallax effects in Webflow?
  2. Are there any alternative libraries to jInvertScroll.js for horizontal scroll and parallax effects in Webflow?
  3. Can I use jInvertScroll.js on specific sections or elements within my Webflow project?