Skip to content

Instantly share code, notes, and snippets.

@thexmanxyz
Last active March 29, 2020 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thexmanxyz/3bf4cca59034c67392228525d437e057 to your computer and use it in GitHub Desktop.
Save thexmanxyz/3bf4cca59034c67392228525d437e057 to your computer and use it in GitHub Desktop.
WOW.js Reanimate Single Elements without init() - normal
// 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