Manually triggering interactions with JS

Hey guys,

based on this post below I was able to trigger my webflow interactions manually. My question is:
Does anybody have an idea how to trigger interactions selector specific?

In the post below the code works if you have a selected element and a trigger by

ix.run(trigger, $el).

I want use a trigger where the triggered element is within the trigger object like so:

var trigger =
{
“type”:“click”,
“selector”:“.toggle”,
“descend”:true,
“preserve3d”:true,
“stepsA”:[{
“display”:“block”,
“transition”:“transform 200 ease 0”,
“x”:“32px”,
“y”:“0px”,
“z”:“0px”,
“rotateX”:“0deg”,
“rotateY”:“0deg”,
“rotateZ”:“-90deg”
}],
“stepsB”:[{
“transition”:“transform 200 ease 0”,
“x”:“0px”,
“y”:“0px”,
“z”:“0px”,
“rotateX”:“0deg”,
“rotateY”:“0deg”,
“rotateZ”:“0deg”
}]
}

so that I could use ix.run(trigger) instead of having to call the element separately.

Thanks in advance :slight_smile:
Marius

Welcome to the Webflow forum!

Could you please edit and provide ALL the necessary details in your post so we can take a look at your site/issue?

In future if you want faster replies and more accurate answers, I suggest including all the details listed in the link above before someone has to ask.

Hope to hear from you soon. Thanks!

hello. I’ve found an solution for usin jQuery trigger with webflow iteractions:

Webflow uses an method to check if the click is valid or not, but only on mobile devices. For some reason, desktop devices always return true;

My solution is to override this method:

$(window).on('load', function(){
  Webflow.validClick = function(){return true}
});

Isn’t perfect and with an update it can stop working…