Jump to content
Search Community

Can't seem to get timeline with scrollTrigger to actually scroll the document when using tweenTo

pr1ntr test
Moderator Tag

Recommended Posts

I have a timeline kinda with a scrollTrigger attached. I am doing something like

mainTimeline.current = gsap.timeline({
  scrollTrigger: {
    trigger: containerRef.current,
    start: 'top top',
    end: 'bottom bottom',
    onSnapComplete,
    snap: {
      snapTo: 'labelsDirectional',
      duration: { min: 0.5, max: 3 },
    },
    scrub: true,
    onUpdate,
  },
})

and then at some predetermined point I want to do this

mainTimeline.current.tweenTo(pathLabel, { duration: 1 })

However, while this does initiate the scroll animations, it does not actually scroll the page. Am I missing something?

Link to comment
Share on other sites

 

Hey @pr1ntr

 

4 hours ago, pr1ntr said:

However, while this does initiate the scroll animations, it does not actually scroll the page. Am I missing something?

 

If you want the page to be scrolled to a certain point, you would probably want to use GSAP's scrollTo-Plugin for that.

That should then also give you the effect you want - the page being scrolled to a certain point, and your scroll-animations being run on the way there.

 

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