Fixed Navbar add icon

I’d like to add a smaller version of my site logo to the left of the HOME link once the page is scrolled down. I had a search but can’t find anything similar, is this possible?

Thanks.

Site: https://enhancedlabs.co.uk/

Hello @coratees,

Thanks for asking. :slight_smile:

Please take a look at the solution mentioned in following thread:

Thanks.

Hi,

Thanks for the speedy reply. Can’t seem to get this to work, any chance you could look at the site for me? I’ll add my wp credentials next post…

Cheers!

Hi @coratees,

That’s an old code with different purpose, here is the updated one

jQuery(function($) {
 $(window).scroll(function() {
   if($('.x-navbar').hasClass('x-navbar-fixed-top')) {
     
      if ( $('.x-nav-wrap.desktop .inline-logo').length == 0 ) $('.x-nav-wrap.desktop ul.x-nav').prepend('<li><a href="https://enhancedlabs.co.uk" class="inline-logo"><img src="http://placehold.it/40?text=Small+Logo!"></a></li>');

   }else{
     $('.x-nav-wrap.desktop .inline-logo').remove();
   }
 });
});

This should serve as a snippet and the idea which you could enhance yourself, we only provided the base and simple implementation where you can start. But we can’t provide further support or enhancement.

Thanks!

That’s perfect, thank you!

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.