Jump to content
Search Community

Stop background page scrolling when ScrollTrigger animates timeline

DeltaFrog test
Moderator Tag

Go to solution Solved by OSUblake,

Recommended Posts

Hi GSAP Fam,

 

Is there a way to stop the page scrolling while ScrollTrigger scrubs through the animation timeline?   Currently when the charts reach the middle of the page the animation scrubs through the crossfade timeline but the page keeps scrolling up behind it.  I'd like the page to stop and wait for the timeline to finish and then everything scrolls up together.   How do I get the page to pin also and wait for the animation to finish before it continues to scroll? 

 

 

Thanks yall!    

 

 

 

See the Pen cc437182656f9da692e58e14d69cb391 by chriscalabrese (@chriscalabrese) on CodePen

Link to comment
Share on other sites

I figure it out.  :D 

I just changed the trigger from pin: true to pin: "body"

 


let tl = gsap.timeline({
  scrollTrigger: {
    trigger: ".centerMeHorz",
    start: "60% 50%",
    end: "2400px top",
     markers: "true",
    scrub: 1,
   
    snap: {
      snapTo: .33,
      duration: 0.01,
      ease: "none"
    },
    pin: "body"
    
  }
  
});

 

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