Jump to content
Search Community

ScrollTrigger pin header and stack cards

NickMasliy test
Moderator Tag

Go to solution Solved by Carl,

Recommended Posts

  • Solution

thanks for the demo. this was a fun little challenge. not sure of all the requirements and I imagine this can be tackled a few ways.

hopefully this works as a starting point.

 

See the Pen dyQMZjq?editors=0010 by snorkltv (@snorkltv) on CodePen

 

Note

  • cards natively have position absolute in css and are stacked on top of each other at y:0
  • i use js to distribute them vertically (index * 200)
  • the timeline animates them all back to y:0 (their normal position)
  • all cards are 200px tall
  • Like 3
Link to comment
Share on other sites

2 hours ago, Carl said:

thanks for the demo. this was a fun little challenge. not sure of all the requirements and I imagine this can be tackled a few ways.

hopefully this works as a starting point.

 

 

 

 

Note

  • cards natively have position absolute in css and are stacked on top of each other at y:0
  • i use js to distribute them vertically (index * 200)
  • the timeline animates them all back to y:0 (their normal position)
  • all cards are 200px tall

Thank you so much, it's really help me:)

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...