Jump to content
Search Community

Recommended Posts

Posted

Hi team!
How can I make this slides automatically play in every 10 seconds or so...
When it reaches the last slide, animation starts from start 

thanks)

 

See the Pen xxmXdJj by mshakhriyorov (@mshakhriyorov) on CodePen.

Posted
3 minutes ago, Rodrigo said:

Hi,

 

You should take a look at this example by @PointC

 

 

 

 

Hopefully this helps.

Happy Tweening!

Hi Rodrigo!
Isn't there any way to make it slide automatically without any handling, or clicking, etc. ?

Posted

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!

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