Jump to content
Search Community

Scrolltrigger inherit: false breaks

anteksiler test
Moderator Tag

Recommended Posts

Hi there,

 

Using defaults to add easing to all animations:

 

gsap.defaults({
	ease: Power4.easeOut
});

However, when we want to cancel this on ScrollTrigger plugin:

 

gsap.to(this.content, {
				clipPath: `inset(0px 4% 0% round 64px)`,
				inherit: false,
				ease: "ease",
        scrollTrigger: {
					trigger: this,
          scrub: 1,
          start: () => 'top bottom',
          end: () => 'bottom bottom'
        }
      });

The animation is not happening.

 

EDIT: Updated codepen. "inherit: false" breaks the animation

See the Pen rNrdMyV by anteksiler (@anteksiler) on CodePen

Link to comment
Share on other sites

Hey,

 

Try changing the scrollTrigger in your codepen to this value and the animation should at least work:

scrollTrigger: {
      trigger: div,
      scrub: 1,
      start: "top bottom",
      end: "bottom bottom",
      markers: true,
    }

 

And regarding the overwriting of the ease, you were probably already on the right track. You can select the possible eases on this page.

But I think you dont need to set inherit: false if you are going to override the value anyway.

 

Hope this helps and good luck with your project.

Link to comment
Share on other sites

Oh ok, I think I see the issue.

See the Pen wvxmrZW?editors=0011 by GreenSock (@GreenSock) on CodePen



The tween's inheriting a default duration of 0.5 from the global defaults and when you state 'inherit:false' it doesn't have a duration so the tween breaks.

 

You'll need to set a duration on the tween in order for it to play if you want to use inherit:false 

 

Hope this helps.

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