Jump to content
Search Community

I want to rotate one image in infinite loop without any interruption or break.

codechirag test
Moderator Tag

Go to solution Solved by Toso,

Recommended Posts

Hello @Toso, thanks a lot for help. It is working fine. just if you can help me in this same thread I have some similar issue in another section in which the current solution is not working. Can you look into this? I am not able to move the cards infinitely in one direction.  here is the code pen of that code. 

See the Pen wvOBoPG by Chirag-Empyreal (@Chirag-Empyreal) on CodePen

 

Thanks again.

Link to comment
Share on other sites

  • Solution

🤔🤔  1 question per day that is the limit,

I'm kidding, and here is your demo 🙏

 

you need to use the https://gsap.com/docs/v3/HelperFunctions/helpers/seamlessLoop  its works on x and y axes, 

 

 

in the demo i only added it to one line of boxes so you can play around it and test the other config

See the Pen MWxYbVr?editors=1010 by ahmed-attia (@ahmed-attia) on CodePen

 

 

also, it can be useful to check this topic on how to create a demo since you were adding the CDN inside your code 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

If you're using React, make sure you read this:

https://gsap.com/react

 

And instead of useLayoutEffect(), I'd recommend the useGSAP() hook. 

 

If you still need help, please provide a minimal demo. Here's a React starter template that you can fork.

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

  • Like 1
Link to comment
Share on other sites

Hello @GSAP Helper, I am adding stackbiz which is the initial snippet from where I started then with the help of Mr.Toso I could make it happen to loop infinitely which is working in Javascript properly, but I wanted to use it with React project that's where the functions of vertical loop and horizontal loop provided here https://gsap.com/docs/v3/HelperFunctions/helpers/seamlessLoop/ not working and the function code is throwing a lot of error just as previous comment screenshot. I have not added that function right now in the stackbiz otherwise project will not run.  Hope now you get my problem. 

See the Pen bGZNYwo by Chirag-Empyreal (@Chirag-Empyreal) on CodePen

 is the working javascript pen. Thanks for your quick response and here is the Stackbiz 

https://stackblitz.com/edit/gsap-react-basic-f48716-rm5kfn?file=src%2FApp.js

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...