I'm using SmoothScrollbar Library and AOS in my HTML website. But AOS animation is not working. Below is my JS code:
我在我的HTML网站上使用SmoothScrollbar库和AOS。但是AOS动画不起作用。下面是我的JS代码:
// ====== 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!
当我删除平滑滚动代码时,AOS工作正常。请帮忙!
As I checked the code in Inspect, aos-animate class is not adding. Here is Screenshot:
当我在Inspect中检查代码时,aos animate类没有添加。这是屏幕截图:
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!