Share Posted March 5, 2021 Hi everyone! I am new to GSAP animation. Faced a problem with the 'scrub' property. Found little information on this property in the docs. Any comments would be welcome. Forgive me for my English, I am from Russia! I hope you got what I meant =) See the Pen YzpjEqb by TogoRot (@TogoRot) on CodePen Link to comment Share on other sites More sharing options...
Share Posted March 5, 2021 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! 1 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 5, 2021 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 More sharing options...
Share Posted March 5, 2021 1 hour ago, Fedya said: For some reason, all triggers are not deleted If you'd like help with that please make a minimal demo of the issue. The code looks fine to me. Link to comment Share on other sites More sharing options...
Author Share Posted March 5, 2021 https://codepen.io/TogoRot/project/editor/ZooEEa# I have commented out some code to make css and html as little as possible. Link to comment Share on other sites More sharing options...
Share Posted March 5, 2021 Thanks for the minimal demo. Here's how I'd do it: https://codepen.io/GreenSock/project/editor/XgevMV 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 5, 2021 so I did not kill triggers correctly) you are the best everywhere to have such support !! Thank you very much for saving my nerves and time! 👍 1 Link to comment Share on other sites More sharing options...
Author Share Posted March 5, 2021 https://codepen.io/TogoRot/project/editor/ZooEEa poser. I made another page and if you go through them all. The trigger remains. even where there are none at all! 😬 Link to comment Share on other sites More sharing options...
Share Posted March 5, 2021 Is there an issue if you remove the ScrollTrigger markers? Link to comment Share on other sites More sharing options...
Author Share Posted March 5, 2021 10 minutes ago, ZachSaucier said: Есть ли проблема при удалении маркеров ScrollTrigger? yes they dig at every transition Link to comment Share on other sites More sharing options...
Share Posted March 5, 2021 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 More sharing options...
Author Share Posted March 5, 2021 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 More sharing options...
Author Share Posted March 5, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now