Changeset 27606
- Timestamp:
- 03/19/2014 05:28:24 AM (11 years ago)
- Location:
- trunk/src/wp-content/themes/twentytwelve
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwelve/css/ie.css
r25715 r27606 105 105 } 106 106 .main-navigation li ul { 107 display: none;108 107 margin: 0; 109 108 padding: 0; … … 111 110 top: 100%; 112 111 z-index: 1; 112 height: 1px; 113 width: 1px; 114 overflow: hidden; 115 clip: rect(1px, 1px, 1px, 1px); 113 116 } 114 117 .ie7 .main-navigation li ul { 118 clip: inherit; 119 display: none; 115 120 left: 0; 121 overflow: visible; 116 122 } 117 123 .main-navigation li ul ul, … … 120 126 left: 100%; 121 127 } 122 .main-navigation ul li:hover > ul { 128 .main-navigation ul li:hover > ul, 129 .main-navigation ul li:focus > ul, 130 .main-navigation .focus > ul { 123 131 border-left: 0; 132 clip: inherit; 133 overflow: inherit; 134 height: inherit; 135 width: inherit; 136 } 137 .ie7 .main-navigation ul li:hover > ul, 138 .ie7 .main-navigation ul li:focus > ul { 124 139 display: block; 125 140 } -
trunk/src/wp-content/themes/twentytwelve/functions.php
r27599 r27606 141 141 142 142 // Adds JavaScript for handling the navigation menu hide-and-show behavior. 143 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( ), '1.0', true );143 wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery' ), '20140318', true ); 144 144 145 145 $font_url = twentytwelve_get_font_url(); -
trunk/src/wp-content/themes/twentytwelve/js/navigation.js
r22574 r27606 1 1 /** 2 * navigation.js 3 * 4 * Handles toggling the navigation menu for small screens. 2 * Handles toggling the navigation menu for small screens and 3 * accessibility for submenu items. 5 4 */ 6 5 ( function() { 7 6 var nav = document.getElementById( 'site-navigation' ), button, menu; 8 if ( ! nav ) 7 if ( ! nav ) { 9 8 return; 9 } 10 10 11 button = nav.getElementsByTagName( 'h3' )[0]; 11 12 menu = nav.getElementsByTagName( 'ul' )[0]; 12 if ( ! button ) 13 if ( ! button ) { 13 14 return; 15 } 14 16 15 17 // Hide button if menu is missing or empty. … … 20 22 21 23 button.onclick = function() { 22 if ( -1 == menu.className.indexOf( 'nav-menu' ) )24 if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { 23 25 menu.className = 'nav-menu'; 26 } 24 27 25 if ( -1 != button.className.indexOf( 'toggled-on' ) ) {28 if ( -1 !== button.className.indexOf( 'toggled-on' ) ) { 26 29 button.className = button.className.replace( ' toggled-on', '' ); 27 30 menu.className = menu.className.replace( ' toggled-on', '' ); … … 32 35 }; 33 36 } )(); 37 38 // Better focus for hidden submenu items for accessibility. 39 ( function( $ ) { 40 $( '.main-navigation' ).find( 'a' ).on( 'focus.twentytwelve blur.twentytwelve', function() { 41 $( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' ); 42 } ); 43 } )( jQuery ); -
trunk/src/wp-content/themes/twentytwelve/style.css
r27572 r27606 591 591 color: #5e5e5e; 592 592 } 593 .main-navigation a:hover { 593 .main-navigation a:hover, 594 .main-navigation a:focus { 594 595 color: #21759b; 595 596 } … … 1510 1511 white-space: nowrap; 1511 1512 } 1512 .main-navigation li a:hover { 1513 .main-navigation li a:hover, 1514 .main-navigation li a:focus { 1513 1515 color: #000; 1514 1516 } … … 1519 1521 } 1520 1522 .main-navigation li ul { 1521 display: none;1522 1523 margin: 0; 1523 1524 padding: 0; … … 1525 1526 top: 100%; 1526 1527 z-index: 1; 1528 height: 1px; 1529 width: 1px; 1530 overflow: hidden; 1531 clip: rect(1px, 1px, 1px, 1px); 1527 1532 } 1528 1533 .main-navigation li ul ul { … … 1530 1535 left: 100%; 1531 1536 } 1532 .main-navigation ul li:hover > ul { 1537 .main-navigation ul li:hover > ul, 1538 .main-navigation ul li:focus > ul, 1539 .main-navigation .focus > ul { 1533 1540 border-left: 0; 1534 display: block; 1541 clip: inherit; 1542 overflow: inherit; 1543 height: inherit; 1544 width: inherit; 1535 1545 } 1536 1546 .main-navigation li ul li a { … … 1547 1557 white-space: normal; 1548 1558 } 1549 .main-navigation li ul li a:hover { 1559 .main-navigation li ul li a:hover, 1560 .main-navigation li ul li a:focus { 1550 1561 background: #e3e3e3; 1551 1562 color: #444;
Note: See TracChangeset
for help on using the changeset viewer.