Skip to content

Instantly share code, notes, and snippets.

@folktrash
Created May 12, 2010 21:00
Show Gist options
  • Save folktrash/399117 to your computer and use it in GitHub Desktop.
Save folktrash/399117 to your computer and use it in GitHub Desktop.
few lines of jquery which will make a css based "flyout" nav acessible via the keyboard and work in ie6.
$(document).ready(function() {
$('#navPrimary').children().focusin(function() { $(this).addClass('accessibleHover'); })
$('#navPrimary').children().focusout(function() { $(this).removeClass('accessibleHover'); })
});
@dandean
Copy link

dandean commented May 13, 2010

Adding the response here for posterity.

You'd have a lot of focusout handlers

 $('#navPrimary').children().focusin(function() {
   // You would re-add the `focusout` handler every time `focusin` was called.
   $(this).addClass('accessibleHover').focusout(function() {
     $(this).removeClass('accessibleHover');
   });
 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment