Trigger interaction with escape key

Hey folks,

is there a way to trigger an interaction with the ESC Key? Maybe with a custom code snippet?

I have a modal which slides in from the bottom and a button which slides it back out of the canvas. I hope that there ist a way to start the fade out interaction by pressing the ESC button.

I hope you guys understand my question, because it is not possible to share a read only link right now.

Thanks,
Marius

There is, its not straight forward though. I´m not a coder by any means, but you could set an eventListener that triggers an action when the ESC-key is pressed. The way I think of it though, the complex thing is that you should write the code for the transition as well (hence javascript in plain English: If key is pressed, move it right, rotate clockwise, set opacity, etc.). If you have the transition in the website via Webflow, you can easily find it in the chrome inspector and copy the code in some javascript.

Perhaps some people actually good in coding, might provide a better way/answer…

2 Likes

http://stackoverflow.com/q/3369593/584192

With this, you can do stuff like removing a class from an element:

  $('.modal').removeClass('open');

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.