Remove sticky behavior from top navigation on twenty fourteen theme?
In wordpress theme twentyfourteen, I am wondering how to remove the sticky behavior of the top navigation with a 100% width header background image like this site?
I would love to have a top image with full width and a max-height with the navigation just placed under it, but the navigation sticks to the top of the window in the browser when you scroll down.
I ended up using the following .js with twentythirteen child theme
//$(document).ready(function() {
jQuery().ready(function($) {
var stickyNavTop = $('.navbar').offset().top;
var stickyNav = function(){
var scrollTop = $(window).scrollTop();
if (scrollTop stickyNavTop) {
$('.navbar').addClass('sticky');
} else {
$('.navbar').removeClass('sticky');
}
};
stickyNav();
$(window).scroll(function() {
stickyNav();
});
});
and added
.sticky { position: fixed; z-index: 100; ... }
Thanks to a post found in here.
I could have apply the same to the twentyfourteen, but it was tricky and I had no time to waste.
Topic theme-twenty-fourteen headers css Wordpress
Category Web