Jump to content
Search Community

Vertical menu selector works on codepen but breaks in dev

The_Orange_Dot test
Moderator Tag

Recommended Posts

Hello.

 

I'm currently trying to create a vertical menu selector using one of GSAP's example codes as the base (this one: 

See the Pen RwKwLWK by GreenSock (@GreenSock) on CodePen

). I don't really have too much trouble customizing the code from a horizontal scroll to a vertical, and it seems to work fine on the codepen. However, when I used the code in VScode, it jumps around when trying to loop back from finish to start again randomly rather than seamlessly looping.

 

The code in the VScode is the exact same code in the codepen.

My page component doesnt have anything in it besides the codepen code.

I'm not sure what's wrong with it.

See the Pen GRPzWMq by mfwkckwy-the-solid (@mfwkckwy-the-solid) on CodePen

Link to comment
Share on other sites

Hi,

 

Maybe you are using React or another UI framework like Vue, Svelte? If so you could check GSAP Context:

https://gsap.com/docs/v3/gsap/methods/gsap.context()

 

We have a series of collections of templates for different frameworks on Stackblitz.

 

React:

https://stackblitz.com/@GreenSockLearning/collections/gsap-react-starters

 

Vue:

https://stackblitz.com/@GreenSockLearning/collections/gsap-vue3-starters

 

Svelte:

https://stackblitz.com/@GreenSockLearning/collections/gsap-svelte-starters

 

Also check this example by @mikel

https://codepen.io/mikeK/details/yLMrwrK

 

Other than that, there is not a lot we can do without a minimal demo that clearly illustrates the issue.

 

Happy Tweening!

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...