So I just recently found out you can trigger Interactions manually with with javascript code.
But i’m having some trouble here.
My main goal is to get interaction triggered by swipe using the Touchwipe jQuery plugin.
My code is here:
<script>
var ix = Webflow.require('ix');
var $el = $('body,html');
var trigger = {"type":"click","selector":".nav-mobile","preserve3d":true,"stepsA":[{"transition":"transform 250ms ease 0","x":"0px","y":"0px","z":"0px"}],"stepsB":[]},{"type":"click","selector":".navline1","preserve3d":true,"stepsA":[{"width":"12px","transition":"transform 100ms ease 0, width 200 ease 0","x":"-2px","y":"1px","z":"0px","rotateX":"0deg","rotateY":"0deg","rotateZ":"-45deg"}],"stepsB":[]},{"type":"click","selector":".navline3","preserve3d":true,"stepsA":[{"width":"12px","transition":"transform 200 ease 0, width 200 ease 0","x":"-2px","y":"-1px","z":"0px","rotateX":"0deg","rotateY":"0deg","rotateZ":"45deg"}],"stepsB":[]},{"type":"click","selector":".screen-overlay","stepsA":[{"display":"block"},{"opacity":1,"transition":"opacity 200 ease 0"}],"stepsB":[]}
$('body,html').touchwipe({
wipeRight: function() { ix.run(trigger, $el); },
min_move_x: 20,
min_move_y: 20,
preventDefaultEvents: true
});
</script>
<script>
var ix = Webflow.require('ix');
var $et = $('body,html');
var trigger = {"type":"click","selector":".nav-mobile","preserve3d":true,"stepsA":[{"transition":"transform 250ms ease 0","x":"-75.5vw","y":"0px","z":"0px"}],"stepsB":[]},{"type":"click","selector":".screen-overlay","stepsA":[{"opacity":0,"transition":"opacity 200 ease 0"},{"display":"none"}],"stepsB":[]},{"type":"click","selector":".navline1","preserve3d":true,"stepsA":[{"width":"17px","transition":"transform 200 ease 0, width 200 ease 0","x":"0px","y":"0px","z":"0px","rotateX":"0deg","rotateY":"0deg","rotateZ":"0deg"}],"stepsB":[]},{"type":"click","selector":".navline3","preserve3d":true,"stepsA":[{"width":"17px","transition":"transform 200 ease 0, width 200 ease 0","x":"0px","y":"0px","z":"0px","rotateX":"0deg","rotateY":"0deg","rotateZ":"0deg"}],"stepsB":[]}
$('body,html').touchwipe({
wipeLeft: function() { ix.run(trigger, $et); },
min_move_x: 20,
min_move_y: 20,
preventDefaultEvents: true
});
</script>
Is there anything I’m doing wrong?