Jump to content
Search Community

Why is the animation not reverse?

Masohas
Moderator Tag

Recommended Posts

Posted

I have question, I wanted reverse animation "showMenuList"(this is pink background), but this not working, where is mistake?

 

I tried many methods but I failed, pls help

See the Pen KKQGgME by jarek-babiak (@jarek-babiak) on CodePen.

Posted

I noticed several problems: 

  1. You keep re-creating the entire timeline/animation on every click. The playhead starts at 0, so if you call .reverse() and make the playhead go in the backward direction, nothing will happen because the playhead is ALREADY at the very start. You should create the timeline outside that method and just reuse the same one consistently. 
  2. You set pause: true instead of paused: true on the timeline constructor
  3. You don't need to wrap things in css: {} anymore - that's a VERY old syntax from almost a decade ago :) you should update to the more modern syntax. See

Is this what you were looking for?: 

See the Pen NWyOddg?editors=0010 by GreenSock (@GreenSock) on CodePen.

  • Like 1
  • Thanks 1
Posted

@GreenSock thank you very much, you are greate

What's the difference between pause: true and paused: true?

Posted
2 minutes ago, Masohas said:

What's the difference between pause: true and paused: true?

There's no such thing as "pause: true" 

 

:)

  • Like 1

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