michalsnik / aos

Animate on scroll library
MIT License
26.81k stars 2.59k forks source link

AOS and Owl Carousel #740

Open jrajasegaram-idc opened 2 years ago

jrajasegaram-idc commented 2 years ago

I'm using AOS and owl carousel to animate elements as you go from slide to slide. The first page works fine, but when I go to the next slide, the elements have already animated. I tested this out with a slide that has a long page. I went straight to that slide and scrolled all the way to the bottom, and then when I go to another page, all the elements (even when you scroll down) have already reached the position (I am mainly using fade ins). Anyone experience this or can provide some guidance? I've tried AOS init before and after carousel initialization.

Here is the code used:

var owl = $('.owl-carousel');
owl.owlCarousel({
    items: 1,
    dots: false,
    loop: false,
    autoplay: false,
    nav: false,
    singleItem: true,
    mouseDrag: false,
    touchDrag: false,
    pullDrag: false,
    freeDrag: false,
    autoWidth: false,
    smartSpeed: 10,
    URLhashListener: true,
    startPosition: 'URLHash',
    margin: 0,
    stagePadding: 0,
    autoHeight: true
});

AOS.init({
    duration: 1000,
    offset: 120,
});
Bleachedreligon28 commented 2 years ago

I have that problem too

leorcdias commented 2 years ago

The same here. I'm waiting for some solution