diff --git a/src/wp-content/themes/twentyfourteen/js/theme.js b/src/wp-content/themes/twentyfourteen/js/theme.js index ee0993dedd..d9160886e2 100644 --- a/src/wp-content/themes/twentyfourteen/js/theme.js +++ b/src/wp-content/themes/twentyfourteen/js/theme.js @@ -117,4 +117,16 @@ } ); + /* Accessibility hover styles for menu. */ + $( '.primary-navigation li' ).hover( function() { + $( this ).addClass( 'a11y-focus' ); + }, function() { + $( this ).delay( '250' ).removeClass( 'a11y-focus' ); + } + ); + $( '.primary-navigation li a' ).on( 'focus blur', function() { + $( this ).parents().toggleClass( 'a11y-focus' ); + } + ); + } )( jQuery ); \ No newline at end of file diff --git a/src/wp-content/themes/twentyfourteen/style.css b/src/wp-content/themes/twentyfourteen/style.css index c532ab59c3..22a85e4960 100644 --- a/src/wp-content/themes/twentyfourteen/style.css +++ b/src/wp-content/themes/twentyfourteen/style.css @@ -685,11 +685,10 @@ body { } .primary-navigation ul ul { background-color: rgba(0, 0, 0, 0.9); - display: none; float: left; position: absolute; top: 48px; - left: 0; + left: -999em; z-index: 99999; } .primary-navigation li li { @@ -698,7 +697,7 @@ body { line-height: 1.6363636363; } .primary-navigation ul ul ul { - left: 100%; + left: -999em; top: 0; } .primary-navigation ul ul a { @@ -715,8 +714,13 @@ body { .primary-navigation ul ul a:hover { color: #8c8c8c; } -.primary-navigation ul li:hover > ul { - display: block; +.primary-navigation ul li:hover > ul, +.primary-navigation ul li.a11y-focus > ul { + left: auto; +} +.primary-navigation ul ul li:hover > ul, +.primary-navigation ul ul li.a11y-focus > ul { + left: 100%; } .primary-navigation li.current_page_item > a, .primary-navigation li.current-menu-item > a {