Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
Trigger anime.js animation when element enters viewport with waypoints

I'm triggering an animation on multiple elements when they are visible in the viewport with waypoints but I run into some problems with animations not working correctly.

What is happening here is that the animations look smooth and correct but are fired on all elements when I scroll a new .sequential element in the viewport. Even the ones that are already animated This is obviously because I target that class in the code. You can see that flickering.

This is how it looks: https://watch.screencastify.com/v/cIKae7lQKMtw4zCXlTlG

This is the code:

$('.sequential').waypoint(function() {
        var CSStransforms = anime({
            targets: '.sequential',
            opacity: [0, 1],
            translateY: [50, 0],
            delay: anime.stagger(100),
            easing: 'cubicBezier(.71,-0.77,.43,1.67)'
        });
    }, {
        offset: '100%'
    });

What I need to do is to instead target 'this.element' in the code instead of the class. It works but the animation is fired at the same time if multiple elements are visible and the animation is not looking as good.

This is how it looks: https://watch.screencastify.com/v/69SVdcXsTywYeYuC6LwQ

This is the code:

$('.sequential').waypoint(function() {
        var CSStransforms = anime({
            targets: this.element,
            opacity: [0, 1],
            translateY: [50, 0],
            delay: anime.stagger(100),
            easing: 'cubicBezier(.71,-0.77,.43,1.67)'
        });
    }, {
        offset: '100%'
    });

How can I make the animation be more sequential even if there are multiple elements visible?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If anyone is looking. This is how I finally solved it. turns out I had to target a wrapping element with waypints before I could call the animation.

$(".anime").waypoint(function() {
  anime.timeline({
    loop: false
  }).add({
    targets: this.element.querySelectorAll('.sequential'),
    translateY: [50, 0],
    opacity: [0, 1],
    duration: 500,
    delay: (el, i) => 100 * i,
    easing: 'cubicBezier(.71,-0.77,.43,1.67)'
  });
}, {
  offset: '100%'
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda