Jump to content
Search Community

Getting Issue with pinning and scrolling

Sandeep Choudhary test
Moderator Tag

Recommended Posts

Hi Guys,

Need some help in issue with pinning and scroll trigger.
What iam trying to do is start scrolling the green section when iam on 20% of image section and scroll till then it cover the purple section. Tried 4-5 solution but not getting any hint where iam doing wrong.  any help or hint will be appreciated.

See the Pen gOyVdgd by SandeepChoudhary (@SandeepChoudhary) on CodePen

Link to comment
Share on other sites

hi @Rodrigo
thanks for taking a look. What iam trying to do is 
When image section is touch the top + 20% then scroll trigger  need to be start and the last section [green one ] start overlapping over purple one and when its fully cover the second last section [Purple one]  it leave the scroll trigger and move forward. Iam able to make animation for overlapping but the section is not stopping when iam pinning the image section.
hopefully this will help you what iam trying to achieve.

Link to comment
Share on other sites

Hi,

 

Maybe something like this:

ScrollTrigger.create({
  trigger: ".parallax-upper-area",
  start: "top+=20% top",
  end: "bottom bottom",
  endTrigger: ".parallax-below-area",
  pin: ".parallax-upper-area",
  pinSpacing: false,
  markers: true
});

Or maybe switch the start to this perhaps:

ScrollTrigger.create({
  trigger: ".parallax-upper-area",
  start: "top top+=20%",
  end: "bottom bottom",
  endTrigger: ".parallax-below-area",
  pin: ".parallax-upper-area",
  pinSpacing: false,
  markers: true
});

Also this could be an option:

ScrollTrigger.create({
  trigger: ".parallax-upper-area",
  start: "top+=20% top",
  end: "+=450",
  pin: ".parallax-upper-area",
  pinSpacing: false,
  markers: true
});

Unfortunately the description you provide is not completely clear to me, so I'm taking my best guesses here in terms of what you're trying to do.

 

Hopefully this helps

Happy Tweening!

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