Jump to content
GreenSock

codanux

Scroll Speed Problem

Moderator Tag
Go to solution Solved by Cassie,

Recommended Posts

Hello, I'm new to Gsap.
When I increase the length between 2 different scenes, pinSpace is created, when I set it to false, the ending value of #section2 becomes #section3. How do I set the ending value to the top of #section3 by expanding #section2.
regards

See the Pen VwyjLNz?editors=0010 by codanux (@codanux) on CodePen

Link to comment
Share on other sites

Hey there.

Welcome to the GSAP forums. I'm sorry but I'm afraid I don't understand this question. Could you rephrase it and explain clearly what you're trying to achieve visually? Maybe setting a different end trigger element could help you?

endTrigger: '#section3' 

Link to comment
Share on other sites

15 minutes ago, Cassie said:

Hey there.

Welcome to the GSAP forums. I'm sorry but I'm afraid I don't understand this question. Could you rephrase it and explain clearly what you're trying to achieve visually? Maybe setting a different end trigger element could help you?

endTrigger: '#section3' 

Hey,

PinSpacing: false

#section2 bottom => #section3 top 

 

 

Screen Shot 2022-03-20 at 5.23.42 PM.png

 

I want

aa.png.e14770caa4be1f875692e16a0198ea14.png

Link to comment
Share on other sites

Hello ,@codanux  change the end to be like  end: 'bottom bottom',
 

const timeline2 = gsap.timeline({
  scrollTrigger: {
    id: 'section2',
    trigger: '#section2',
    scrub: true,
    markers: true,
    pin: true,
    start: 'top top',
    end: 'bottom bottom',
    pinSpacing: true, // end padding problem
    endTrigger: '#section3'
  }
});

 

Link to comment
Share on other sites

7 minutes ago, Cassie said:

Like this?
 


 

 

 

yes this works for me but I need to speed down #section2 so I need to add it.


 end: 'bottom+=150% top',

Link to comment
Share on other sites

Hey @codanux,

 

You could also use one forEach function (for both sections).
And function based values combined with invalidateOnRefresh:true for the scrollTrigger.

I like to test / choose the speed with appropriate relative values for the parameter 'end'.

 

See the Pen RwxGNZz by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

 

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