Jump to content
Search Community

Stagger Animation: Loop Through Columns

Banddev test
Moderator Tag

Recommended Posts

I want to reveal each column with a stagger effect, each column should fade in when they appear in the viewport using scrolltrigger. 

 

but it seems that I am doing something wrong because the 2 columns on the same row, fade in at the same time, with no delay between each other.

 

how can I ensure that each column reveals with a different delay and create a staggered effect?

is this wrong? did I misunderstand the work of "stagger"?  😥

 

    const anims = gsap.utils.toArray('.img-container');

    anims.forEach((anim) => {
      gsap.set(anim, { y: 40, opacity: 0});

      ScrollTrigger.create({
        trigger: anim.parentElement,
        start: 'top bottom-=100',
        end: () => `+=${anim.clientHeight }`,
        markers: true,
        onEnter: () => {
          gsap.to(anim, {y: 0, opacity: 1, duration: 0.6, stagger:1});
        },
      })
    });

thanks



 

See the Pen GRBMKmE?editors=1010 by mp1985 (@mp1985) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...