Jump to content
Search Community

Need help with scrollTrigger onEnter

Oleksandr07 test
Moderator Tag

Recommended Posts

How to change the start and end position of scrollTrigger after running the onEnter event?

ScrollTrigger.create({
  trigger: '.box',
  start: 'top top',
  end: 'bottom bottom',
  ease: "power0.easeNone",
  scrub: true,
  pin: true,
  pinReparent: true,
  invalidateOnRefresh: true,
  markers: true,
  onEnter: ({progress, direction, isActive}) => {
    // change start and end options
  }
});

 

Edited by Oleksandr07
Add code example
Link to comment
Share on other sites

Usually when I see someone trying to dynamically change ScrollTrigger instance values like that, it's more of a problem with how they're engineering things or their setup - it's not that they actually need to dynamically change things. If you think you've got a scenario where you genuinely need that functionality and cannot use the existing API, I'd love to see a minimal demo, as @OSUblake said.

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