Make WordPress Core

Changeset 25757


Ignore:
Timestamp:
10/10/2013 03:32:59 PM (11 years ago)
Author:
lancewillett
Message:

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

File:
1 edited

Legend:

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

    r25735 r25757  
    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 
     120    /* Focus styles for primary menu. */
     121    $( '.primary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
     122        $( this ).parents().toggleClass( 'focus' );
     123    });
    132124} )( jQuery );
Note: See TracChangeset for help on using the changeset viewer.