Created
May 12, 2010 21:00
-
-
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.
Thanks for looking yo! By that same logic, could one also:
$('#navPrimary').children().focusin(function() { $(this).addClass('accessibleHover').focusout(function() { $(this).removeClass('accessibleHover');
? Or is that crazy talk?
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
Your performance would be pretty poor with this. Could be much better to store the result of
$('#navPrimary').children()
, then callfocusin
andfocusout
on that.Before this change:
After the change: