AOS(Animation On Scroll) Library doesn't work with SmoothScrollbar-js

131 Views Asked by At

I'm using SmoothScrollbar Library and AOS in my HTML website. But AOS animation is not working. Below is my JS code:

// ====== SMOOTH SCROLL ======
var Scrollbar = window.Scrollbar;
  Scrollbar.init(document.querySelector('#smooth_scrollbar'), {
    damping: 0.05,          // Controls the damping effect
    alwaysShowTracks: true, // Always show scrollbar tracks
});


// ==== AOS ANIMATION ====
$(document).ready(function () {
    setTimeout(() => {
        AOS.init({
            offset: 120,
        });
    }, 120);
    // AOS.init();
})

When I remove the Smooth Scroll code, AOS works fine. Please help!

As I checked the code in Inspect, aos-animate class is not adding. Here is Screenshot: Inspect Screenshot

0

There are 0 best solutions below