Skip to content

Instantly share code, notes, and snippets.

@PaulGwamanda
Created November 2, 2017 09:49
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save PaulGwamanda/bcdfd1adea5144fefa1a9d6939340b67 to your computer and use it in GitHub Desktop.
Save PaulGwamanda/bcdfd1adea5144fefa1a9d6939340b67 to your computer and use it in GitHub Desktop.
Wow.js repeat animation on scroll up or down
WOW.prototype.addBox = function(element) {
this.boxes.push(element);
};
// Init WOW.js and get instance
var wow = new WOW();
wow.init();
// Attach scrollSpy to .wow elements for detect view exit events,
// then reset elements and add again for animation
$('.wow').on('scrollSpy:exit', function() {
$(this).css({
'visibility': 'hidden',
'animation-name': 'none'
}).removeClass('animated');
wow.addBox(this);
}).scrollSpy();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment