Jump to content
Search Community

Change start and end with timeline and scrollTrigger

ilovecheese test
Moderator Tag

Recommended Posts

I have setup a minimal demo, from my existing code. As you scroll, the items pass from right to left, but what if I want #1 to start in the middle and #8 to end in the middle? What if the timeline started a little earlier and ended a little sooner? I can set css manually for the first two items to achieve this, but I thought it would be easier with gsap.

 

Wanting to start here:image.thumb.png.5715146282b292e0957a739427b1b58c.png

 

... and wanting to end here:

image.thumb.png.ded0713568f3f2d3570bb9a6718c6b54.png

See the Pen ZEPKWyy by ilovecheese (@ilovecheese) on CodePen

Link to comment
Share on other sites

Okay, what you have works, but I think in my production code, it won't work. Below is another updated demo, which reflects closer to my production code. I have two timelines, one for an intro, and another for the items. If I start a parent timeline early, then the intro will already be faded halfway out, which is not what I want. Thanks!

 

See the Pen JjzNKao by ilovecheese (@ilovecheese) on CodePen

Link to comment
Share on other sites

Sorry - I'm not following, but you don't need to put the intro and the scrubbed progress timeline on the same parent.

 

In your revised demo you have:

.add(items(), '<');

which adds that at the start of the previous animation. Did you mean to have it start after the intro?

 

More details would be helpful as I'm just not understanding the desired outcome.

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