Created
November 2, 2017 09:49
-
-
Save PaulGwamanda/bcdfd1adea5144fefa1a9d6939340b67 to your computer and use it in GitHub Desktop.
Wow.js repeat animation on scroll up or down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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