Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse not working properly #586

Open
Madeon08 opened this issue Jun 27, 2019 · 1 comment
Open

Reverse not working properly #586

Madeon08 opened this issue Jun 27, 2019 · 1 comment

Comments

@Madeon08
Copy link

Bug
Hello, thanks for the great plugin.

I just noticed an issue by using the last version 3.0.1

When I play an animation, it works, then I click to reverse, the movement is played but without any transition/duration. The translation is done but we don't see it.

With version 3.0.0 it works fine.

Hope this helps 😃

My code

const AboutLAction = anime({
          targets: $about_left,
          translateX: ['-100%', '0'],
          autoplay: false,
          easing: 'easeInOutQuart',
          duration: 1200
        });

       AboutLAction.reverse();

       const handleClick = () => {

          AboutLAction.play();
          AboutLAction.reverse();
        };

       $buttonhome.addEventListener('click', () => {
          handleClick();
        });

        $buttonabout.addEventListener('click', () => {
         handleClick();
        });
@muuvmuuv
Copy link

Try this:

  function hide() {
    this.timeline.play()
    this.timeline.finished.then(() => {
      this.timeline.reverse()
    })
  },

  function show() {
    this.timeline.play()
    this.timeline.finished.then(() => {
      this.timeline.reverse()
    })
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants