Jump to content
Search Community

ScrollTrigger Scrub not work

Fedya test
Moderator Tag

Recommended Posts

I assume you meant to do something like this?: 

See the Pen 2c9bec970e7151cb11c598d54fa68035?editors=0010 by GreenSock (@GreenSock) on CodePen

 

The problem with your version was that your ScrollTrigger didn't have any "animation" linked to it, so the scrub property won't do anything (there's nothing to scrub). You were just creating a new animation every time the onEnter fired. 

 

I hope that helps. Happy tweening!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Yes, I did such a standard approach)
but I would also like to add the onEnterBack animation to this trigger.

 

And if it's not hard for you to look at the codepen code in the comment. where I kill the trigger and init again.
For some reason, all triggers are not deleted. Already like the whole forum has read = (but still did not understand how to do it right!

Link to comment
Share on other sites

59 minutes ago, Fedya said:

they dig at every transition

What do you mean by this?

 

Also keep in mind that this is a GSAP forum. Given the issue seems to be primarily stemming from the usage with Barba, I don't know how much free support we can offer. My guess is that with the right combination of Barba hooks it will work well. I haven't used Barba much.

Link to comment
Share on other sites

sorry. I mean they are not deleted in html if you look in devtool. I've tried all the barba hooks but the triggers remain.

 

that's why I created triggers separately from animation. they are so removed, but not created and there is no control over the animation.

 

anyway, thank you very much for trying to help me.

Link to comment
Share on other sites

two days later I did it. I wonder what it didn’t work .... maybe I made a mistake somewhere before!

 

I've already seen such a solution on the forum. but can anyone come in handy

 

barba.hooks.beforeLeave(() => {
  ScrollTrigger.getAll().forEach(trigger => trigger.kill())
});
barba.hooks.after(() => {
  initScrolling();
});
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...