mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Twenty Twelve: make small-screen menu accessible to keyboard commands and voice-driven software by using a focusable button element rather than h3
for the toggle element. Fixes #28224, props rclations.
Built from https://develop.svn.wordpress.org/trunk@29095 git-svn-id: http://core.svn.wordpress.org/trunk@28881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
47bdd8cbd0
commit
8a0a5ce1d2
@ -140,7 +140,7 @@ function twentytwelve_scripts_styles() {
|
||||
wp_enqueue_script( 'comment-reply' );
|
||||
|
||||
// Adds JavaScript for handling the navigation menu hide-and-show behavior.
|
||||
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140608', true );
|
||||
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140711', true );
|
||||
|
||||
$font_url = twentytwelve_get_font_url();
|
||||
if ( ! empty( $font_url ) )
|
||||
|
@ -40,7 +40,7 @@
|
||||
</hgroup>
|
||||
|
||||
<nav id="site-navigation" class="main-navigation" role="navigation">
|
||||
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
|
||||
<button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
|
||||
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
|
||||
</nav><!-- #site-navigation -->
|
||||
|
@ -8,7 +8,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
button = nav.getElementsByTagName( 'h3' )[0];
|
||||
button = nav.getElementsByTagName( 'button' )[0];
|
||||
menu = nav.getElementsByTagName( 'ul' )[0];
|
||||
if ( ! button ) {
|
||||
return;
|
||||
|
@ -272,6 +272,7 @@ input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
.menu-toggle:hover,
|
||||
.menu-toggle:focus,
|
||||
button:hover,
|
||||
input[type="submit"]:hover,
|
||||
input[type="button"]:hover,
|
||||
|
Loading…
Reference in New Issue
Block a user