Interaction triggered by custom code

I’d like to make a Webflow interaction that can be triggered by calling a function in the custom code section. If I’m not mistaken, this isn’t currently possible.

One way I think it could be worked into the UI is to add another option to the triggers.

It could be called “Javascript” or something. When clicked, it brings up a text area where you can name the function. That way you can call that function from the custom code.

The use case I have in mind is that I want to perform an animation once some of the page assets (image and audio files) have fully downloaded).

EDIT: Now I’m thinking it might be better if it wasn’t only trigger, but also a property that can be entered in the interaction’s Settings panel. That way, if you want it to also be triggered by one of Webflow’s built-in triggers, it can do both.