Press ESC to exit menu
Hi, I have a suggestion - it would be great to enable keyboard commands for accessibility reasons, eg. pressing the Escape key to close the full screen overlay as described at: https://foxland.fi/accessible-full-screen-menu/
I've written a basic workaround for now (it closes and opens the menu with the ESC key):
//Call Fatnav.js
$.fatNav();
//Open and close menu with ESC Key
$(document).on('keydown', function(e) {
if (e.keyCode === 27) { // ESC Key
$(".fat-nav").fadeToggle(400); //Fade menu overlay in/out
$(".hamburger").toggleClass('active'); //Change appearance of clickable icon
}
});
Improvised from: http://stackoverflow.com/a/9333628 Tested working in Chrome v.50
But a new function for this feature would be great :)
I just discovered a bug in my solution in IE11 (and possibly lower versions) - when pressing ESC the scale transform animation doesn't trigger, so the menu gets stuck in an oversized mode. So beware of that if you use this.
The keyboard feature will soon be implemented
Any update on this?