Hi,
I’m trying to get a separate header for the sticky header and I’m using code I found from an older thread. I set my fixed header to have a transparent background so now when the sticky logo appears, the main logo remains there.
How can I make the main logo disappear when the sticky logo appears? Here’s the code I used:
jQuery(function($) {
$('<img class="my-logo" src="http://localhost/xthemes/wordpress/wp-content/uploads/2018/02/U.svg">').insertBefore('.x-nav-wrap.desktop .x-nav');
$('.my-logo').hide();
$(window).scroll(function() {
var scrollPos = $(window).scrollTop();
if($('.x-navbar').hasClass('x-navbar-fixed-top') && scrollPos > 100 ) {
$('.my-logo').show();
} else {
$('.my-logo').hide();
}
});
});
Unfortunately I’m working on a local server so I can’t provide you with a working link.