graingert / WOW

Reveal CSS animation as you scroll down a page
https://wowjs.uk
Other
1.58k stars 1.56k forks source link

callback #22

Open mhebrard opened 5 years ago

mhebrard commented 5 years ago

I use wow to animates few element on my page with success.

I wish to use wow to trigger other js functions when item are visible. I try to use callback option but it doesn't seams to work

var wow = new WOW(
    {
      callback:     function(box) {
        // the callback is fired every time an animation is started
        // the argument that is passed in is the DOM node being animated
        console.log("!! WOW !!");
      }
    }
  );
  wow.init();

the animations are triggered, but nothing is logged

graingert commented 5 years ago

@mhebrard, have you tried using AOS.js? Also can you repeat the issue on a sandbox? https://codesandbox.io

mhebrard commented 5 years ago

hmm it work on sandbox: https://codesandbox.io/s/r4q11vy0wn I look more closely in my code and come back to you ... sorry for the trouble