Jump to content
Search Community

Help with beginner tweenLite user

sick911 test
Moderator Tag

Go to solution Solved by Ihatetomatoes,

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,

 

I have been trying to create an image carousel for a website, I found Greensock out of a recommendation because jQuery animations aren't as fluid, I looked at the beginner tutorials from Petr and also followed a tutorial he has on youtube, I have been having problems making the images rotate as shown in my codepen.

 

Can someone help me please?

See the Pen pyPLvj by alvaro911 (@alvaro911) on CodePen

Link to comment
Share on other sites

  • Solution

Hi Alvaro, great to see you experimenting with GSAP.

 

Which of my tutorials have you followed?

 

I've only quickly looked at your code and see a few errors:

function goToTile(sildeIn, slideOut)

// should be slideIn, also you have tl twice in that function
// also I would include var in front of slideIn 

var slideIn = ...

My suspicion is that the way you are passing the slideIn into the goToTile function is returning wrong object on a second click.

 

Try to console log this and see if it returns the right object all the time:

slideIn = slideOut.parent().children('.view').eq(index);

Sorry I couldn't help more atm, but I hope it steers you into the right direction.

  • Like 2
Link to comment
Share on other sites

Hi Alvaro,

 

Normally I don't consider a good idea to use a timeline class for a carousel/slider. I find much simpler using a Tween class for every slide, but that's just me.

 

Here's a very simple example of a content slider:

 

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

 

Also here's a slider crafted by Jonathan using a timeline class:

 

See the Pen qxsfc?editors=0010 by jonathan (@jonathan) on CodePen

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