-
Notifications
You must be signed in to change notification settings - Fork 206
Close Modal by the Escape key #60
Comments
Props to @onetrev for this code // close modal menu if esc key is used
|
This doesn't work for me. Should I need to be adding anything else? |
you need to make sure your var matches. here this should help.
|
also I add support to close modal with Escape key joaopereirawd#60
I use this code but its not working ? any solution ?
|
if your modal is working other than the esc close? then check the key you are pressing is in fact registering as keycode 27 https://keycode.info/ |
Yes modal work well but close by esc doesn't work.I checked keycode and its 27 but it doesn't work. Is there any other solution ? |
Anyone have solution to fix close by esc ? |
animatedModal does not have a close function (for now ;-) ). // Close (every) modal if Escape key is pressed.
jQuery(document).keyup(function(ev){
if(ev.keyCode == 27) {
jQuery('.modal-container [class^="close-fancyModal_"]').trigger('click');
}
}); |
I'd love to be able to close the modals with the
ESC
key. I believe, this would be an intuitive behaviour for the user.The text was updated successfully, but these errors were encountered: