Share Posted July 27, 2022 Hi there, Is it possible to disable infinite loop as I want to user to slide right or left for going through items. After reaching to end user can not drag more. See the Pen GRJwLNP by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 27, 2022 Hey there! Sure - what have you tried so far? 1 Link to comment Share on other sites More sharing options...
Author Share Posted July 27, 2022 Hi Cassie, I have a very messy code in my local as I have tried every possible way I know. I used above code and playing with it. But no required so far. If you could just let me know how we can stop infinite loop. I set repeat 0 also but it is not stoping repeat. 1 Link to comment Share on other sites More sharing options...
Share Posted July 27, 2022 I'm afraid I'd have to dig in to this pen, work out what's happening and figure that out myself - if I knew the answer I'd happily just tell you. I don't have the time for this right now. I'll take a look later if no one else has jumped in but here's where I would start. Right now the progress of the timeline is being wrapped using a GSAP util so that when it gets past 1 it loops back to the beginning and starts at 0 again.https://greensock.com/docs/v3/GSAP/UtilityMethods/wrap() you will want to change that so that the value can only be between 0 and 1. i.e. the start and the end of the timeline. Link to comment Share on other sites More sharing options...
Share Posted July 27, 2022 Removing the autoplay for now and just manually clicking through and doing some console.log()'s would also be a good start. 1 Link to comment Share on other sites More sharing options...
Share Posted July 27, 2022 Here's a fork with a "wrap" Boolean variable you can set: See the Pen abYLPoW?editors=0010 by GreenSock (@GreenSock) on CodePen Does that help? 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