jquery-fatNav icon indicating copy to clipboard operation
jquery-fatNav copied to clipboard

Press ESC to exit menu

Open drawcard opened this issue 9 years ago • 4 comments

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/

drawcard avatar May 22 '16 08:05 drawcard

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 :)

drawcard avatar May 22 '16 08:05 drawcard

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.

drawcard avatar Jun 13 '16 13:06 drawcard

The keyboard feature will soon be implemented

Glitchbone avatar Jun 14 '16 10:06 Glitchbone

Any update on this?

johanneslamers avatar Sep 05 '16 10:09 johanneslamers