Jump to content
GreenSock

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

Reverse single animation on single click

Go to solution Solved by OSUblake,

Recommended Posts

Hi all, i'm new to Gsap and web developing in general.

I have a quick question regarding gsap and a single animation.

Clicking the "+", the animation starts, but i want to animate it even when i re-click it, like to dissolve it.

Don't care about the styling. 

Thanks in advance. 

See the Pen MWEWadb by tiba22 (@tiba22) on CodePen

Link to comment
Share on other sites

  • Solution

Welcome to the forums @Tiba

 

You need to create your animations outside of the event handler.

 

See the Pen XWeWpKm by GreenSock (@GreenSock) on CodePen

 

  • Like 2
Link to comment
Share on other sites

15 hours ago, OSUblake said:

Welcome to the forums @Tiba

 

You need to create your animations outside of the event handler.

 

 

 

 

Thank you for your answer and the solution. 

I surely need to study more :P
 

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