Jump to content
Search Community

ScrollTrigger - Scroll to label in timeline?

Douglas test
Moderator Tag

Recommended Posts

I have a large timeline animation and I need to be able to scroll to positions within it. I'm using ScrollTrigger, and I see that it has this:

https://greensock.com/docs/v3/Plugins/ScrollTrigger/scroll()

 

But I don't see how I'm supposed to add this to a timeline?

 

I've used timeline.seek(), but this doesn't update the actual scroll position. 

 

Any help is greatly appreciated!

See the Pen poybVzy by DouglasGlover (@DouglasGlover) on CodePen

Link to comment
Share on other sites

On 8/18/2020 at 10:08 AM, ZachSaucier said:

Hey Douglas. This is a good use case for the ScrollToPlugin. In fact, we have a demo doing just this listed in the ScrollTrigger docs

 

Applied to your situation:

 

 

 

Hey again @ZachSaucier, I'm actually having a bit of a time implementing this on the site I shared with you yesterday. I have one long timeline that scrolls through the site (horizontal scroll). The sections are all variable width, have parallel techniques applied etc..

 

I tried implementing as-is from the demo in the hopes that it'd just sorta know where things are, but everything on the page is position: fixed and scrolls in from the right, so maybe it just thinks everything is at the "top" or something. Any insights you might be able to provide given my situation? I can provide more detailed info if there's something specific that might help.

 

EDIT: I've fiddled some more and I see that I need to move to a certain position in the timeline based on the total timeline compared to the position of the section. Also I have multiple pages and am realizing that maybe the nav in my site hasn't been designed around that being the case, realistically this should be a sub-nav of some manner rather than a site nav.

 

Apologies again - it's going to be custom and require much finagling. -.-

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