Changeset 21616
- Timestamp:
- 08/25/2012 04:50:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentytwelve/js/navigation.js
r21611 r21616 5 5 */ 6 6 ( function() { 7 8 7 var button = document.getElementById( 'site-navigation' ).getElementsByTagName( 'h3' )[0], 8 menu = document.getElementById( 'site-navigation' ).getElementsByTagName( 'ul' )[0]; 9 9 10 11 10 if ( undefined == button || undefined == menu ) 11 return false; 12 12 13 14 15 13 button.onclick = function() { 14 if ( -1 == menu.className.indexOf( 'nav-menu' ) ) 15 menu.className = 'nav-menu'; 16 16 17 18 19 20 21 22 23 24 17 if ( -1 != button.className.indexOf( 'toggled-on' ) ) { 18 button.className = button.className.replace( ' toggled-on', '' ); 19 menu.className = menu.className.replace( ' toggled-on', '' ); 20 } else { 21 button.className += ' toggled-on'; 22 menu.className += ' toggled-on'; 23 } 24 }; 25 25 26 27 28 26 // Hide menu toggle button if menu is empty. 27 if ( ! menu.childNodes.length ) 28 button.style.display = 'none'; 29 29 } )();
Note: See TracChangeset
for help on using the changeset viewer.