Jump to content
Search Community

Can I add a pin function in the middle?

kku98057 test
Moderator Tag

Recommended Posts

Thank you For starters, always so much for your help too.

 

Just watch the mobile version.
Text animation will not start until the pin function is started.

But what I want is that the text in the first purple background is animated while scrolling down and then the pin is executed.

What should I do?

 

reference site

 

https://www.apple.com/kr/iphone-13/

It is located at the bottom of the site.

See the Pen zYpoKYN#unsupported-modal by kku98057 (@kku98057) on CodePen

Link to comment
Share on other sites

Hi there!

 

There's a lot of code here for a seemingly simple question so I'm struggling to understand exactly what it is that you're trying to do.

In terms of your question - You can pin and animate things separately. You just have to specify that, and place the triggers and start and end points in the right place for your use case.

e.g. (pseudo code)
 

// animate
gsap.from(text, {
  opacity: 0,
  yPercent: 60,
  duration: 1,
  scrollTrigger: {
    trigger: something,
    start: "top center"
  }
});

// pin
ScrollTrigger.create({
  trigger: container,
  pin: true,
  start: "top top"
})

 

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