Skip to content Skip to sidebar Skip to footer

Wow.js Not Working Properly With Wordpress

So I'm trying to get wow.js (and Animate.css) working on my Wordpress templates. I've got them all linked up fine (it throws no errors) and the animations do work but for some reas

Solution 1:

Enqueuing wow.init() and adding wow.js as a dependency works for me:

add_action( 'wp_enqueue_scripts', 'b5f_wow_init' );

functionb5f_wow_init() {
    wp_register_script( 'wow', get_stylesheet_directory_uri() . '/js/wow.min.js' );
    wp_enqueue_script( 'my-wow', get_stylesheet_directory_uri() . '/js/my-wow.js', array( 'wow' ), null, true );
    wp_enqueue_style( 'wow-css', get_stylesheet_directory_uri() . '/css/animate.min.css' );
}

And my-wow.js as default values:

var wow = new WOW(
  {
    boxClass:     'wow',      // animated element css class (default is wow)
    animateClass: 'animated', // animation css class (default is animated)
    offset:       0,          // distance to the element when triggering the animation (default is 0)
    mobile:       false// trigger animations on mobile devices (true is default)
  }
);
wow.init();

Post a Comment for "Wow.js Not Working Properly With Wordpress"