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

How do I use .stop() with AnimeJS? #368

Closed
Committing opened this issue Apr 27, 2018 · 1 comment
Closed

How do I use .stop() with AnimeJS? #368

Committing opened this issue Apr 27, 2018 · 1 comment

Comments

@Committing
Copy link

How do I use .stop(true) with AnimeJS?

Assuming I have code:

anime({
  targets: 'div',
  translateX: 100,
  duration: 2000,
  loop: 3, // Play the animation 3 times
  direction: 'reverse', // Play the animation in reverse
  autoplay: false // Animation paused by default
});

Would I just have to do:

$('div').stop(true);

anime({
  targets: 'div',
  translateX: 100,
  duration: 2000,
  loop: 3, // Play the animation 3 times
  direction: 'reverse', // Play the animation in reverse
  autoplay: false // Animation paused by default
});

Or is there a better way I'm supposed to do this?

Thanks

@juliangarnier
Copy link
Owner

Hey,

You can use .pause() / .play()
http://animejs.com/documentation/#playPause

or anime.remove(theElementToRemove).

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