Trigger script when interaction done

Hi. Is there an event that is triggered when an interaction ends that I could use to trigger a javascript function? Specifically, I’m looking to have an element fade-out, trigger a script, and fade back in with new data (inner html). I previously was able to do it using animate.css and an event listener.

It looks like the interactions features in Pinegrow could simplify the other animations in my project, so I would be looking to replace the animate.css method with interactions in Pinegrow.

In other words, I’m looking for a way to have the end of an interaction trigger an event. Is there a practical way? I’ve looked into adding a class to an element, but it’s not clear to me how to use that to trigger a different interaction.


Hi, Yes, there is a way:

You can trigger another PG Interaction by using a transition “Interactions > Play animation” at the end of your timeline.

If you want to trigger a JS function you can use “Interaction > Call function (on complete)”

1 Like

Thanks very much. I did see the Call function (on complete) option. I’ll look for it. JS