Jump to content
GreenSock

Learning

Simple carousel

Go to solution Solved by Dipscom,

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

Hi guys,

 

I'm trying to do a simple carousel where slide 1 moves out and slide 2 moves in...

But I'm not sure what is the issue causing slide 2 not to appear.

When I check the details in browser, I notice that it did have a transform matrix, and when I uncheck the transform, it appears.

When I hide slide 1, the transform works. Hmm...

Here's the simplified test which get similar errors.

 

See the Pen qRMKKY by kelvinzhao (@kelvinzhao) on CodePen

Link to comment
Share on other sites

  • Solution

Hello Learning,

 

You issue is in your CSS positioning. You need to set the slides to be absolute if you want them to occupy the same spot in the DOM, otherwise they will be stacked on top of each other.

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