Twenty Fourteen: improved JS support for keyboard navigation for main navigation menu. Props obenland, see #25054.

git-svn-id: https://develop.svn.wordpress.org/trunk@25757 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2013-10-10 15:32:59 +00:00
parent 822d558774
commit 6a433a7284

View File

@ -117,16 +117,8 @@
} ); } );
/* Accessibility hover styles for menu. */ /* Focus styles for primary menu. */
$( '.primary-navigation li' ).hover( function() { $( '.primary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
$( this ).addClass( 'a11y-focus' ); $( this ).parents().toggleClass( 'focus' );
}, function() { });
$( this ).delay( '250' ).removeClass( 'a11y-focus' );
}
);
$( '.primary-navigation li a' ).on( 'focus blur', function() {
$( this ).parents().toggleClass( 'a11y-focus' );
}
);
} )( jQuery ); } )( jQuery );