Jump to content
Search Community

Vertical scroll inside container

RainyMonday test
Moderator Tag

Recommended Posts

Hello

A few days ago I started playing with GSAP. I would like to make a simple vertical list of items inside container. I found a very similar solution to what I need  (codepen).

The only difference is that I want all elements to be visible one below the other and not overlapping like on codepen. I tried editing the CSS but I don't think it's enough.

 

I'm attaching a preview showing a static list that I want to animate. On the right hand side is the list that I want to animate. I simply want the list items to go up as you scroll down.

 

Thanks in advance for any tips.

list.png

See the Pen KKmWxQp by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

Welcome to the forums @RainyMonday

 

I find it much easier to reason about ScrollTrigger animations if you don't include ScrollTrigger. Yes, just remove ScrollTrigger from the equation and figure out the animation first. 

 

Pretty easy, right?

 

See the Pen KKZEpjR by GreenSock (@GreenSock) on CodePen

 

Now just add a ScrollTrigger to it and you should be good 😉

 

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