Jump to content
Search Community

ScrollMagic / GSAP / Animate one by one

Androlax test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello,

 

I have a little problem, I can't figure out how to fix it. It seems to be pretty simple, but I don't find how to do it.

 

I would like to, when I come on a line of ".post" element, I would like the .post element to be animate ONE BY ONE, and not all at the same time, I searched on internet, tryed some things, but I couldn't figure out how to do it.

 

Here is a codepen to show you an example :

 

 

Thanks for your help.

See the Pen KKPrMwx by th-o-benoit (@th-o-benoit) on CodePen

Link to comment
Share on other sites

You'll need to check the distance from the top for each element and figure out how many rows you have. Then you can create a scene for each row and stagger the targets. You'll use a global trigger element, but set an offset for each row. Here's a demo from a different thread, but shows the technique.

 

See the Pen aeJxJE by PointC (@PointC) on CodePen

 

This is not responsive. You'll need to make adjustments and listen for a resize event if that's a requirement for your project, but it should get you started. Happy tweening.

:)

 

  • Like 3
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...