Twenty Thirteen: remove fixed navbar. Closes #24184.
git-svn-id: https://develop.svn.wordpress.org/trunk@24169 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
200549ee5f
commit
3118731338
@ -8,21 +8,15 @@
|
|||||||
* @subpackage Twenty_Thirteen
|
* @subpackage Twenty_Thirteen
|
||||||
* @since Twenty Thirteen 1.0
|
* @since Twenty Thirteen 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* Add class to allow styling for toolbar.
|
|
||||||
*/
|
|
||||||
$html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
|
|
||||||
|
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<!--[if IE 7]>
|
<!--[if IE 7]>
|
||||||
<html class="ie ie7 <?php echo $html_class; ?>" <?php language_attributes(); ?>>
|
<html class="ie ie7" <?php language_attributes(); ?>>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<!--[if IE 8]>
|
<!--[if IE 8]>
|
||||||
<html class="ie ie8 <?php echo $html_class; ?>" <?php language_attributes(); ?>>
|
<html class="ie ie8" <?php language_attributes(); ?>>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<!--[if !(IE 7) | !(IE 8) ]><!-->
|
<!--[if !(IE 7) | !(IE 8) ]><!-->
|
||||||
<html class="<?php echo $html_class; ?>" <?php language_attributes(); ?>>
|
<html <?php language_attributes(); ?>>
|
||||||
<!--<![endif]-->
|
<!--<![endif]-->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php bloginfo( 'charset' ); ?>" />
|
<meta charset="<?php bloginfo( 'charset' ); ?>" />
|
||||||
|
@ -7,13 +7,8 @@
|
|||||||
( function( $ ) {
|
( function( $ ) {
|
||||||
var html = $( 'html' ),
|
var html = $( 'html' ),
|
||||||
body = $( 'body' ),
|
body = $( 'body' ),
|
||||||
navbar = $( '#navbar' ),
|
|
||||||
_window = $( window ),
|
_window = $( window ),
|
||||||
toolbarOffset = body.is( '.admin-bar' ) ? 28 : 0,
|
|
||||||
navbarOffset = navbar.offset().top - toolbarOffset,
|
|
||||||
scrollOffsetMethod = ( typeof window.scrollY === 'undefined' ),
|
|
||||||
adjustFooter,
|
adjustFooter,
|
||||||
adjustAnchor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a top margin to the footer if the sidebar widget area is
|
* Adds a top margin to the footer if the sidebar widget area is
|
||||||
@ -29,45 +24,10 @@
|
|||||||
$( '#colophon' ).css( 'margin-top', margin + 'px' );
|
$( '#colophon' ).css( 'margin-top', margin + 'px' );
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Repositions the window on jump-to-anchor to account for navbar
|
|
||||||
* height.
|
|
||||||
*/
|
|
||||||
adjustAnchor = function() {
|
|
||||||
if ( window.location.hash )
|
|
||||||
window.scrollBy( 0, -49 );
|
|
||||||
};
|
|
||||||
|
|
||||||
$( function() {
|
$( function() {
|
||||||
adjustAnchor();
|
|
||||||
|
|
||||||
if ( body.is( '.sidebar' ) )
|
if ( body.is( '.sidebar' ) )
|
||||||
adjustFooter();
|
adjustFooter();
|
||||||
} );
|
} );
|
||||||
_window.on( 'hashchange.twentythirteen', adjustAnchor );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Displays the fixed navbar based on screen position.
|
|
||||||
*/
|
|
||||||
if ( _window.innerWidth() > 644 ) {
|
|
||||||
_window.on( 'scroll.twentythirteen', function() {
|
|
||||||
var scrollOffset = scrollOffsetMethod ? document.documentElement.scrollTop : window.scrollY;
|
|
||||||
|
|
||||||
if ( scrollOffset > navbarOffset )
|
|
||||||
html.addClass( 'navbar-fixed' );
|
|
||||||
else
|
|
||||||
html.removeClass( 'navbar-fixed' );
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows clicking the navbar to scroll to top.
|
|
||||||
*/
|
|
||||||
navbar.on( 'click.twentythirteen', function( event ) {
|
|
||||||
// Ensure that the navbar element was the target of the click.
|
|
||||||
if ( 'navbar' == event.target.id || 'site-navigation' == event.target.id )
|
|
||||||
$( 'html, body' ).animate( { scrollTop: 0 }, 'fast' );
|
|
||||||
} );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables menu toggle for small screens.
|
* Enables menu toggle for small screens.
|
||||||
|
@ -966,51 +966,6 @@ ul.nav-menu li:hover > ul,
|
|||||||
width: 230px;
|
width: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fixed Navbar */
|
|
||||||
.navbar-fixed {
|
|
||||||
margin-top: 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wp-toolbar.navbar-fixed {
|
|
||||||
margin-top: 73px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-fixed .site-title {
|
|
||||||
font-size: 22px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 2;
|
|
||||||
max-width: 400px;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0;
|
|
||||||
position: fixed;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
top: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
z-index: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-fixed .site-title {
|
|
||||||
color: #141412;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-fixed .navbar {
|
|
||||||
box-shadow: 0 2px 2px rgba(173, 165, 105, 0.2);
|
|
||||||
height: 45px;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wp-toolbar.navbar-fixed .site-title,
|
|
||||||
.wp-toolbar.navbar-fixed .navbar {
|
|
||||||
top: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-fixed .menu-toggle,
|
|
||||||
.navbar-fixed .nav-menu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5.0 Content
|
* 5.0 Content
|
||||||
@ -3253,7 +3208,6 @@ footer.entry-meta {
|
|||||||
.widget-area,
|
.widget-area,
|
||||||
.main-navigation,
|
.main-navigation,
|
||||||
.navbar,
|
.navbar,
|
||||||
.navbar-fixed .site-title,
|
|
||||||
.more-link {
|
.more-link {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user