Changeset 24169
- Timestamp:
- 05/03/2013 06:22:57 PM (13 years ago)
- Location:
- trunk/wp-content/themes/twentythirteen
- Files:
-
- 3 edited
-
header.php (modified) (1 diff)
-
js/functions.js (modified) (2 diffs)
-
style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentythirteen/header.php
r24072 r24169 9 9 * @since Twenty Thirteen 1.0 10 10 */ 11 12 /*13 * Add class to allow styling for toolbar.14 */15 $html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';16 17 11 ?><!DOCTYPE html> 18 12 <!--[if IE 7]> 19 <html class="ie ie7 <?php echo $html_class; ?>" <?php language_attributes(); ?>>13 <html class="ie ie7" <?php language_attributes(); ?>> 20 14 <![endif]--> 21 15 <!--[if IE 8]> 22 <html class="ie ie8 <?php echo $html_class; ?>" <?php language_attributes(); ?>>16 <html class="ie ie8" <?php language_attributes(); ?>> 23 17 <![endif]--> 24 18 <!--[if !(IE 7) | !(IE 8) ]><!--> 25 <html class="<?php echo $html_class; ?>"<?php language_attributes(); ?>>19 <html <?php language_attributes(); ?>> 26 20 <!--<![endif]--> 27 21 <head> -
trunk/wp-content/themes/twentythirteen/js/functions.js
r24070 r24169 8 8 var html = $( 'html' ), 9 9 body = $( 'body' ), 10 navbar = $( '#navbar' ),11 10 _window = $( window ), 12 toolbarOffset = body.is( '.admin-bar' ) ? 28 : 0,13 navbarOffset = navbar.offset().top - toolbarOffset,14 scrollOffsetMethod = ( typeof window.scrollY === 'undefined' ),15 11 adjustFooter, 16 adjustAnchor;17 12 18 13 /** … … 30 25 }; 31 26 32 /**33 * Repositions the window on jump-to-anchor to account for navbar34 * height.35 */36 adjustAnchor = function() {37 if ( window.location.hash )38 window.scrollBy( 0, -49 );39 };40 41 27 $( function() { 42 adjustAnchor();43 44 28 if ( body.is( '.sidebar' ) ) 45 29 adjustFooter(); 46 } );47 _window.on( 'hashchange.twentythirteen', adjustAnchor );48 49 /**50 * Displays the fixed navbar based on screen position.51 */52 if ( _window.innerWidth() > 644 ) {53 _window.on( 'scroll.twentythirteen', function() {54 var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY;55 56 if ( scrollOffset > navbarOffset )57 html.addClass( 'navbar-fixed' );58 else59 html.removeClass( 'navbar-fixed' );60 } );61 }62 63 /**64 * Allows clicking the navbar to scroll to top.65 */66 navbar.on( 'click.twentythirteen', function( event ) {67 // Ensure that the navbar element was the target of the click.68 if ( 'navbar' == event.target.id || 'site-navigation' == event.target.id )69 $( 'html, body' ).animate( { scrollTop: 0 }, 'fast' );70 30 } ); 71 31 -
trunk/wp-content/themes/twentythirteen/style.css
r24167 r24169 967 967 } 968 968 969 /* Fixed Navbar */970 .navbar-fixed {971 margin-top: 45px;972 }973 974 .wp-toolbar.navbar-fixed {975 margin-top: 73px !important;976 }977 978 .navbar-fixed .site-title {979 font-size: 22px;980 font-weight: bold;981 line-height: 2;982 max-width: 400px;983 overflow: hidden;984 padding: 0;985 position: fixed;986 text-overflow: ellipsis;987 top: 0;988 white-space: nowrap;989 z-index: 3;990 }991 992 .navbar-fixed .site-title {993 color: #141412;994 }995 996 .navbar-fixed .navbar {997 box-shadow: 0 2px 2px rgba(173, 165, 105, 0.2);998 height: 45px;999 position: fixed;1000 top: 0;1001 z-index: 2;1002 }1003 1004 .wp-toolbar.navbar-fixed .site-title,1005 .wp-toolbar.navbar-fixed .navbar {1006 top: 28px;1007 }1008 1009 .navbar-fixed .menu-toggle,1010 .navbar-fixed .nav-menu {1011 display: none;1012 }1013 1014 969 1015 970 /** … … 3254 3209 .main-navigation, 3255 3210 .navbar, 3256 .navbar-fixed .site-title,3257 3211 .more-link { 3258 3212 display: none;
Note: See TracChangeset
for help on using the changeset viewer.