Jump to content
Search Community

GSAP carousel slider on Vue 3

Mukhriddin test
Moderator Tag

Recommended Posts

Hi,

 

You can use a function to change the slide and a GSAP DelayedCall in order to use a timer that you can pause and restart as you please:

https://greensock.com/docs/v3/GSAP/gsap.delayedCall()

 

This is a super old example (over 9 years ago) and it definitely needs an overhaul but I don't have the time to update it now:

See the Pen JjRdxP by rhernando (@rhernando) on CodePen

 

But the relevant part of the code is this:

pauseTime = 2,
timerFunction = TweenLite.delayedCall(pauseTime, changeSlide),

In the animation created in the changeSlide function, use an onComplete to restart the timerFunction. The syntax is old but the way DelayedCall works hasn't change since, so it should provide a good starting point.

 

Hopefully this helps.

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