Last active
March 29, 2020 13:43
-
-
Save thexmanxyz/3bf4cca59034c67392228525d437e057 to your computer and use it in GitHub Desktop.
WOW.js Reanimate Single Elements without init() - normal
This file contains hidden or 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
// If you want to explicitly trigger an animation for certain WOW.js elements again. No need to call `init()` and also not wanted (all elements are reset): | |
var triggerAnimation = function(selector, animation) { | |
var $element = $(selector); // get element | |
var element = $element[0]; // get JS element | |
var newone = element.cloneNode(true); // clone it | |
element.parentNode.replaceChild(newone, element); // and replace the old with clone | |
$element = $(selector); // get cloned jQ element | |
$element.addClass('wow ' + animation + ' animated'); // apply animations | |
$element.attr('style', 'visibility: visible; animation-name: ' + animation + ';'); // and styles | |
}; | |
triggerAnimation('.your_selector, 'zoomIn'); // element to reanimate and animation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment