Jump to content
Search Community

Run timelineMax on click

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

Hi Shaun,

I've made a codepen with my case:

See the Pen BrZKGJ by ZenTao (@ZenTao) on CodePen

When I click an icon I want to do something with those divs "animateMe" and "fading". Is there any possibility to prevent to run the timelineMax again until the animation is completed?

https://codepen.io/ZenTao/pen/BrZKGJ

Thanks

Edited by DevSaver
Give a link to codepen
Link to comment
Share on other sites

I'm not sure if Shaun will be online again today so I'll jump back in. It looks like you're using GSAP to set() a new class name on click, but that class is a CSS transition? That may cause problems as mixing the two will many times result in a fight for control of the element.

 

I don't think we understood you wanted to do this with multiple elements in a jQuery each() loop. Here's a basic demo of creating a timeline for each() jQuery element and checking a global variable to see if a click should allow the timeline to play. 

 

See the Pen rvZKVg by PointC (@PointC) on CodePen

 

Hopefully that helps. Happy tweening.

:)

 

 

 

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