Is it possible to add wordpress actions to elements generated at runtime?

I have a few elements that are rendered with javascript on my page which become regular DOM elements when viewed in the browser. Problem is, I can’t select them in order to add wordpress actions to it. Is there a way around this?

Hi Roel,

have you turned javascript on in Pinegrow? For me, that did the trick. It’s a button on top in the middle.

For me it even works when I change something in the DOM with an onclick=“myfunction()” and such. Although I’m now more working with the WordPress side of Pinegrow.

Yes, it is turned on. To be more specific about what I’m doing, I’m rendering a bodymovin/lottie web animation (as I understand it, lottie web by airbnb is a javascript “rendering engine” that renders after effects animations exported to JSON format with the bodymovin plugin).

did you ever get Lottie files working in Pinegrow? I’m a motion designer looking to start opening up into HTML / websites as well

Excuse the lateness of my reply.

Well, yes and no. Lottie works perfectly well in Pinegrow in the sense that it displays the animation even inside the pinegrow preview window if you follow lottie’a documentation. but what I wanted to do was insert php code in the svg via pinegrow wordpress actions. This does not work and was admittedly a silly idea to begin with on my part… Also, lottie doesn’t seem to play nice with Wordpress. I haven’t really gotten it to work properly as it doesn’t seem to find the javascript file needed for it. I’m sure there is a way to do it, I just haven’t found it yet. Anyway, it has been some time since I’ve really tried as I have been occupied with other things.

Does this answer your question?


thanks for the reply and it’s totally understandable with all that’s going on in the world, so thank you for taking the time to reply :slight_smile:

I think it does a bit, I assumed that Lottie would be ok within a site created in Pinegrow, I was just wondering if controlling the Lottie animations would be straightforward, such as integrating the animation with page position or starting and stopping when in view.

I’m afraid I can’t really answer that. Perhaps there would be a way to use the interactions api together with the scroll scene in the lottie javascript file but I’m not sure… Worth the try though. If I ever get to testing that put I’ll let you know.