| Server IP : 217.160.0.15 / Your IP : 216.73.216.30 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : u37981780 ( 1696858) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/43/d124547881/htdocs/app395378437/wp-content/themes/gazette/js/ |
Upload File : |
( function( $ ) {
var debounce = function( func, wait ) {
var timeout, args, context, timestamp;
return function() {
context = this;
args = [].slice.call( arguments, 0 );
timestamp = new Date();
var later = function() {
var last = ( new Date() ) - timestamp;
if ( last < wait ) {
timeout = setTimeout( later, wait - last );
} else {
timeout = null;
func.apply( context, args );
}
};
if ( ! timeout ) {
timeout = setTimeout( later, wait );
}
};
};
function headerStyle() {
var featuredContent, featuredContentHeight;
featuredContent = $( '#featured-content' );
featuredContentHeight = 0;
if ( featuredContent.length ) {
featuredContentHeight = featuredContent.outerHeight();
}
if ( $( '.site-branding' ).outerWidth() === 0 ) {
$( 'body' ).addClass( 'no-branding' );
} else {
$( 'body' ).removeClass( 'no-branding' );
}
if ( $( '.site-branding' ).outerWidth() + $( '.main-navigation' ).outerWidth() + 15 >= $( '.site-header-inner' ).outerWidth() && $( window ).width() > 839 ) {
$( 'body' ).addClass( 'long-menu' );
$( '.main-navigation' ).css( 'margin-top', '' );
} else if ( $( window ).width() < 840 ) {
$( 'body' ).removeClass( 'long-menu' );
$( '.main-navigation' ).css( 'margin-top', '' );
} else {
$( 'body' ).removeClass( 'long-menu' );
$( '.main-navigation' ).css( 'margin-top', ( $( '.site-header' ).height() - $( '.main-navigation' ).outerHeight() ) / 2 );
}
$( window ).scroll( function() {
if ( $( document.body ).hasClass( 'unfixed-header' ) ) {
return;
}
if ( $( document ).scrollTop() > featuredContentHeight && $( window ).width() > 959 ) {
$( document.body ).addClass( 'fixed' ).css( 'padding-top', $( '#masthead' ).outerHeight() );
} else {
$( document.body ).removeClass( 'fixed' ).css( 'padding-top', '' );
}
} );
}
$( window ).load( headerStyle ).resize( debounce( headerStyle, 500 ) );
} )( jQuery );