Access Webflow Interactions from JS (keydown)

Hey,
I like to run a webflow interaction “on key down” of the space bar. Any idea how to address an interacion I’ve made directly in webflow with jQuery?:
Here is my script:

   $(function () {
	$(document).keyup(function(e) {
		if(e.which == 32) {
   			// Spacebar pressed
                    //  I need the code to address a specific Webflow interaction that runs also on click
 		 }
	});
   });

Put in the custom code section.

Project → Custom Code → Footer

or

Design → Page → Page Details → Customer Code → Footer

Thanks for reply, but I know where to put the script. I need the script how to access Webflow interactions via jQuery. But thanks!

oic. sorry I misunderstood.

There is a webflow object you can access but it’s been awhile since I did that.

I would have to dig into some history.

Fastest and best person(s) to answer that question I think would be @callmevlad or @thesergie

Check out this topic: https://discourse.webflow.com/t/how-to-run-webflow-actions-from-js

1 Like

Hi NvdB31,
this sounds good, but I can’t access this link. It seems to be protected.

Hi Revolution, thanks for your help. I’ll keep diging :wink:

just got back in. gave my iphone to my kid. Poor me had to upgrade to an iphone 7+ :frowning:

didn’t realize that they had 128 and 256 versions now… was forced to get the 256 version.

the link @NvdB31 posted was there earlier. I saw it myself.

And I had forgotten about that post. Been awhile since I saw it… about 3 years ago.

Add @danro to the list of best people to answer this question.

I think he’s the original author… as it’s attributed to him on github.

Anyways… it seems they moved the post today.

Here’s the new url

Great, I found this page and it works good, but im wondering if it’s possible to address only the name of an action to copy it’s content into a variable. This would be helpful when I change my action in Webflow: it should be changed in my custom trigger, too.