Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
andystent

Animate 2 slideshows on 1 click

Recommended Posts

Hey! Really hoping you geniuses can help me out...

 

I have 2 slideshows (Slides and Titles). They work well independently of each other with separate buttons controlling the next/prev Slide, or next/prev Title.

 

I need to have both Slides and Titles animate when clicking the same next/prev buttons.

 

When I do set them to use the same button only one of the slideshows changes.

 

Note: the reason I went for separate slideshows is that the Titles need to sit on top of the image Slides, rather than being nested in each slide, like normal.

 

Any help would be very much appreciated!

 

Shout out to Jonathan Marzullo for the amazing looping slideshow JS - https://codepen.io/jonathan/

See the Pen gJRavQ by andystent (@andystent) on CodePen

Link to comment
Share on other sites

Hi @andystent,

 

There's a lot going on in your pen .. and a lot of duplication of work which could be greatly simplified. That said ... consolidating everything (kind of as is) into single calls will make one button press control two sets of tweens.

 

See the Pen mYwOdP?editors=0110 by sgorneau (@sgorneau) on CodePen

 

But, you should look at refactoring your code to get rid of unnecessary complexities.

  • Like 3
Link to comment
Share on other sites

Hi @andystent,

 

Welcome to the GreenSock Forum.

 

What is the reason behind 'the Titles need to sit on top of the image slides'?

What effect would you like to achieve?

 

Best regards

Mikel

 

 

Link to comment
Share on other sites

Shaun! You are an absolute legend! Thank you so much. I know what you mean about the duplicate code but I ended up doing that cus I couldn't get it to work in a more consolidated way. I'll implement this and see what I can do to simplify it.

Thank again

  • Like 1
Link to comment
Share on other sites

On 5/17/2019 at 6:48 PM, mikel said:

Hi @andystent,

 

Welcome to the GreenSock Forum.

 

What is the reason behind 'the Titles need to sit on top of the image slides'?

What effect would you like to achieve?

 

Best regards

Mikel

 

 

@mikel Thank you. Essentially the images would scroll across the screen when the button is clicked but the title wrapper will always be visible in the same spot. I hope that makes sense. Thank again.

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