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

wow is not playing once when we hide then show the elements #13

Closed
roro1993 opened this issue Dec 15, 2017 · 2 comments
Closed

wow is not playing once when we hide then show the elements #13

roro1993 opened this issue Dec 15, 2017 · 2 comments

Comments

@roro1993
Copy link

roro1993 commented Dec 15, 2017

the page loads and the animation plays and finishes.. expected not to animate again

for a certain reason i need to display none the wrapper of one of the animated elements and show it back on a certain condition..

when i show it back the animation inside this wrapper plays again..

how can i stop this behavior??

how can we for example add a class that stops any attempt of the animation after that the element has already animated..

@roro1993 roro1993 changed the title wow is not playing once wow library is not playing once when we hide then show the elements Dec 15, 2017
@roro1993 roro1993 changed the title wow library is not playing once when we hide then show the elements wow is not playing once when we hide then show the elements Dec 15, 2017
@roro1993
Copy link
Author

I found out how to do this

  function afterReveal(e){
    e.addEventListener('animationend', function () {
      $(e).addClass('no-animation');
    });
  }

  var wow = new WOW({
    offset:       100,
    callback: afterReveal
  });
  wow.init();

and this class

.no-animation{
  animation: unset;
}

@graingert
Copy link
Owner

graingert commented Dec 15, 2017 via email

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