Skip to content

Instantly share code, notes, and snippets.

@KaiserEMP
Last active January 29, 2018 12:18
Show Gist options
  • Select an option

  • Save KaiserEMP/7bdb275280d6cd502bee209efdcab554 to your computer and use it in GitHub Desktop.

Select an option

Save KaiserEMP/7bdb275280d6cd502bee209efdcab554 to your computer and use it in GitHub Desktop.
function reserveHeaderSpace() {
if (!$('body').hasClass('not-top')) {
var headerHeight = $('header.header').outerHeight();
$('.content-wrap').css('padding-top', headerHeight);
} else {
$('.content-wrap').css('padding-top', '');
}
}
reserveHeaderSpace();
$(window).on('load resize',function() {
/* Cookiebar */
$('.cookie_box .accept').click(function(){
$('.cookie_disclaimer').fadeOut(500, function(){
$('body').removeClass('cookiebar-visible');
reserveHeaderSpace();
});
$.ajax({
type: 'POST',
url: ajaxurl,
data: { action: 'cookie_session' }
});
});
reserveHeaderSpace();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment