# Trigger script when interaction done

**URL:** <https://forum.pinegrow.com/t/trigger-script-when-interaction-done/8206>\
**Category:** Pinegrow Interactions Add-on\
**Created:** [July 4, 2023, 1:41am UTC](https://forum.pinegrow.com/t/trigger-script-when-interaction-done/8206 "2023-07-04T01:41:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnsantana](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@johnsantana](https://forum.pinegrow.com/u/johnsantana)\
**Post date:** [July 4, 2023, 1:41am UTC](https://forum.pinegrow.com/t/trigger-script-when-interaction-done/8206/1 "2023-07-04T01:41:11Z")

</div>

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.

Thanks  
JS

---

<div class="post-metadata">

**Author:** ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)\
**Post date:** [July 4, 2023, 6:02am UTC](https://forum.pinegrow.com/t/trigger-script-when-interaction-done/8206/2 "2023-07-04T06:02:27Z")

</div>

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)”

---

<div class="post-metadata">

**Author:** ![johnsantana](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@johnsantana](https://forum.pinegrow.com/u/johnsantana)\
**Post date:** [July 4, 2023, 6:13pm UTC](https://forum.pinegrow.com/t/trigger-script-when-interaction-done/8206/3 "2023-07-04T18:13:35Z")

</div>

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