• pict3000

    (@pict3000)


    WOW.js instructions are SO simple, and yet I can’t get it to work on my wordpress onetone-pro site http://demoseer.com/

    My child functions.php has this in it:

    add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' );
    function my_child_theme_scripts() {
     wp_enqueue_style( 'animate-stylesheet', get_stylesheet_directory_uri() . '/animate.css', array(), '', 'all' );
       wp_enqueue_script( 'wow-js', get_stylesheet_directory_uri() . '/wow.min.js', array('animate-stylesheet'), '', 'all' );
    }

    The WOW documentation mentioned that the wow.min.js had a dependency for animate.css, so I think my enqueueing reflects that. It doesn’t work with or without that dependency in the enqueue.

    This is also in my functions.php to initialize WOW in the header as per documentation:

    function wow_init(){?>
    <script>
     new WOW().init();
    </script>
    <?php }
    add_action( 'wp_head', 'wow_init' );

    Then I tried putting class=”wow” in various element tags via the custom code input in one section of onetone’s homepage. No scroll reveals. Nothing, ever.

    I suspect that combinations of selectors are causing the wow class to not be found. I don’t know.

    Any ideas (please!).

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter pict3000

    (@pict3000)

    The same problem occurs with scrollReveal.js — really simple to implement on non-wordpress site but not working on my onetone-pro/wordpress site.

    Huh??? Everything is enqueued. Markup is correct.

    stephencottontail

    (@stephencottontail)

    On your site, I don’t even see wow.min.js loaded. From my testing, you can’t pass a handle that’s been enqueued via wp_enqueue_style() to wp_enqueue_script(). When you tried to enqueue wow.js without the dependency, what code did you use? Did you receive any errors?

    For your second issue, it looks like you may need to enqueue scrollReveal in the header:

    <?php wp_enqueue_script( 'scroll-reveal', '/path/to/js', array(), null, false ); ?>

    Thread Starter pict3000

    (@pict3000)

    Stephen,

    I did not get any errors when I left out the dependency like this:

    wp_enqueue_script( 'wow-js', get_stylesheet_directory_uri() . '/wow.min.js', array(), '', 'all' );

    But hey, I’m eternally grateful for your suggestion to enqueue scrollReveal in the header that way. It worked! I still have to get wow.js to work, though, just so it won’t bug me 😀

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wow.js not working’ is closed to new replies.