Studio7 Posted April 22, 2022 Share Posted April 22, 2022 HI everybody, since this is my first time here, before i start, i want to thank everybody for everytime i found a solution in this forum. That said, i'm trying to remove the loop functionality in the beautiful See the Pen LYRwgPo by GreenSock (@GreenSock) on CodePen you did but i'm pretty new w gsap and i'm getting a lot of error and issues. Every hint, advice or direction to follow would be appreciated.. thank you again See the Pen LYevWGx by na86 (@na86) on CodePen Link to comment Share on other sites More sharing options...
Solution OSUblake Posted April 22, 2022 Solution Share Posted April 22, 2022 Welcome to the forums @Studio7 To prevent it from looping, you just need to get rid of the wrapForward/wrapBackward calls. onUpdate(self) { if (self.progress === 1 && self.direction > 0 && !self.wrapping) { // wrapForward(self); } else if (self.progress < 1e-5 && self.direction < 0 && !self.wrapping) { // wrapBackward(self); } else { scrub.vars.totalTime = snap((iteration + self.progress) * seamlessLoop.duration()); scrub.invalidate().restart(); // to improve performance, we just invalidate and restart the same tween. No need for overwrites or creating a new tween on each update. self.wrapping = false; } See the Pen PoEgOOm by GreenSock (@GreenSock) on CodePen But that's a rather complicated demo to learn from. It might be easier to start out small and build up to what you want following this article. And, of course you can ignore the looping parts, but the animations might still be helpful. Going “Meta GSAP”: The Quest for “Perfect” Infinite Scrolling | CSS-Tricks - CSS-Tricks 3 Link to comment Share on other sites More sharing options...
Studio7 Posted April 22, 2022 Author Share Posted April 22, 2022 That was fast.. i will definitely read the article. Don't now how i missed it so far.. guess internet is full of cool stuff, right?! Don't know how to thank you @OSUblake 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