Sercotec Posted June 11, 2022 Share Posted June 11, 2022 I won't provide a demo this time because i dont know if it is achivable a hypotethic question: Is it possible to change a scroll trigger variable after completition of animation. A sample code like : var tl = gsap.timeline({ scrollTrigger: { trigger: ".hero", start: "center 50%", end: "bottom top", toggleActions: "play reset restart resume", //markers: true, scrub:1, pin:".hero", pinSpacing:true (Something like : onComplete () => pinSpacing:false) } }) Thanks in advance! Link to comment Share on other sites More sharing options...
GreenSock Posted June 11, 2022 Share Posted June 11, 2022 I don' think that'd make much sense because if you suddenly got rid of pinSpacing when it completed, all the stuff on your page would suddenly jump because the pinSpacing would collapse. Can you help us understand why you want to do something like this? I mean you can definitely disable() a ScrollTrigger or kill() it or set once: true so that it only plays once. By the way, if you set a scrub value, that overrules any toggleActions (it's logically impossible to have both), FYI. A minimal demo would go a long way toward helping us understand what you're attempting. Link to comment Share on other sites More sharing options...
Sercotec Posted June 11, 2022 Author Share Posted June 11, 2022 Its live demo on : https://sercotec.net/demo/gsap/ I want orange section to overlap first section after the animation of texts finished. if i use pinSpace:false it overlaps yet animation is not finished yet. So getting rid of Pinspacing not affecting entire page but only the animation of these two sections. ( I can implement other scrollTriggers for the rest of the page) And i dont want to put sections to Arrays like you do in your demos. I hope it helps. Thank you. Link to comment Share on other sites More sharing options...
Sercotec Posted June 11, 2022 Author Share Posted June 11, 2022 Actually i found a sample : See the Pen 274c3f7a269a327db37dcd069fd6ed20 by akapowl (@akapowl) on CodePen this is exactly what i want to achive yet i couldnt solve the relation between those codes (they definetely do the trick) : (you can check it in pen's code) gsap.set('.content', { marginTop: "-100vh" }) .... end: '+=' + (600 + window.innerHeight) ... end: '+=600px' Link to comment Share on other sites More sharing options...
Sercotec Posted June 11, 2022 Author Share Posted June 11, 2022 Actually reached my goal playing with these parameters, thank you ! 1 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