Make WordPress Core

Changeset 25731


Ignore:
Timestamp:
10/08/2013 05:55:46 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: provide keyboard support for the primary navigation, props joedolson. See #25054.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/js/theme.js

    r25214 r25731  
    118118    } );
    119119
     120    /* Accessibility hover styles for menu. */
     121    $( '.primary-navigation li' ).hover( function() {
     122            $( this ).addClass( 'a11y-focus' );
     123        }, function() {
     124            $( this ).delay( '250' ).removeClass( 'a11y-focus' );
     125        }
     126    );
     127    $( '.primary-navigation li a' ).on( 'focus blur', function() {
     128            $( this ).parents().toggleClass( 'a11y-focus' );
     129        }
     130    );
     131   
    120132} )( jQuery );
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r25730 r25731  
    686686.primary-navigation ul ul {
    687687    background-color: rgba(0, 0, 0, 0.9);
    688     display: none;
    689688    float: left;
    690689    position: absolute;
    691690        top: 48px;
    692         left: 0;
     691        left: -999em;
    693692    z-index: 99999;
    694693}
     
    699698}
    700699.primary-navigation ul ul ul {
    701     left: 100%;
     700    left: -999em;
    702701    top: 0;
    703702}
     
    716715    color: #8c8c8c;
    717716}
    718 .primary-navigation ul li:hover > ul {
    719     display: block;
     717.primary-navigation ul li:hover > ul,
     718.primary-navigation ul li.a11y-focus > ul {
     719    left: auto;
     720}
     721.primary-navigation ul ul li:hover > ul,
     722.primary-navigation ul ul li.a11y-focus > ul {
     723    left: 100%;
    720724}
    721725.primary-navigation li.current_page_item > a,
Note: See TracChangeset for help on using the changeset viewer.