momo12 Posted July 19, 2023 Share Posted July 19, 2023 Hello guys. I have created this simple loop but the image 1 doesn't appear right behind the last image which is image 4. Is there a way to correct this? Am I doing something wrong? :) See the Pen KKrROwG by talewoy290 (@talewoy290) on CodePen Link to comment Share on other sites More sharing options...
Solution akapowl Posted July 19, 2023 Solution Share Posted July 19, 2023 Hello there, Momo. Getting loops like that right will involve quite some consideration. Luckily for you, @GreenSock has created a helper function for looping like that. It is is mentioned in the thread linked below among others, and also in the docs' Helper Function section.https://greensock.com/docs/v3/HelperFunctions#loop See the Pen xxQjvrV by akapowl (@akapowl) on CodePen 2 Link to comment Share on other sites More sharing options...
momo12 Posted July 19, 2023 Author Share Posted July 19, 2023 9 minutes ago, akapowl said: Hello there, Momo. Getting loops like that right will involve quite some consideration. Luckily for you, @GreenSock has created a helper function for looping like that. It is is mentioned in the thread linked below among others, and also in the docs' Helper Function section.https://greensock.com/docs/v3/HelperFunctions#loop Thanks a lot for this! Is there a way to let users scroll? Or it affects the movement of the slider? Link to comment Share on other sites More sharing options...
akapowl Posted July 19, 2023 Share Posted July 19, 2023 9 minutes ago, momo12 said: Is there a way to let users scroll? Sure. The helper function returns a timeline; so you could tween the progress of that timeline hooked up to ScrollTrigger or Observer. 2 Link to comment Share on other sites More sharing options...
momo12 Posted July 19, 2023 Author Share Posted July 19, 2023 4 minutes ago, akapowl said: Sure. The helper function returns a timeline; so you could tween the progress of that timeline hooked up to ScrollTrigger or Observer. Thanks a lot! To understand the code correctly: I must always use a grid? Link to comment Share on other sites More sharing options...
akapowl Posted July 19, 2023 Share Posted July 19, 2023 2 minutes ago, momo12 said: To understand the code correctly: I must always use a grid? Neither the horizontal-, nor the vertical-loop examples linked on the documentation page I referred you to above, do use a grid; So I suppose the answer for your question is: No, you don't have to use a grid at all. See the Pen ZELPxWW by GreenSock (@GreenSock) on CodePen See the Pen MWXPgKm by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
momo12 Posted July 19, 2023 Author Share Posted July 19, 2023 11 minutes ago, akapowl said: Neither the horizontal-, nor the vertical-loop examples linked on the documentation page I referred you to above, do use a grid; So I suppose the answer for your question is: No, you don't have to use a grid at all. You're a life saver! Thanks a lot 2 Link to comment Share on other sites More sharing options...
akapowl Posted July 19, 2023 Share Posted July 19, 2023 I'm merely just the messenger here; The true life saver is GreenSock 2 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