Jump to content
Search Community

Slideshow with previous and next

JobV test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

It's not really good idea to just copy paste code in codepen when asking for help on forum. For example, you have posted images which are not present, the next and previous buttons are labeled as test1, test2 and most importantly your slider wasn't even visible to see what and if anything is happening.

 

Anyway,

  1. nothing was working because you copied exact same code for next button and renamed it for previous button and click event was created on wrong id.
  2. I fixed that and added a little more code so if you click fast, it will speed up the ongoing animation and then it will call next slide in 0.1 second.
  3. I also changed all animations to animate xPercent instead of left, because animating left/top can give you poor performance.
  4. On every click event you have this code 'TweenLite.to(playBtn, {});', what do you expect it to do?

See the Pen jZrNyJ?editors=0010 by Sahil89 (@Sahil89) on CodePen

 

  • Like 4
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...