Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1292607
    dbv
    Participant

    Hi,

    I would like the logo to change when scrolling down. I’ve had success with this script I found but I don’t know how to control the size and placement of the second logo.

    (function($){
     $(window).bind('scroll', function() {
       if ($(this).scrollTop() > 600) { 
         $('.x-navbar .x-brand img').attr('src','http://www.digitalabildverkstan.se/test/wp-content/uploads/2016/10/dbv_mark_black.png');
       }else{
         $('.x-navbar .x-brand img').attr('src','http://www.digitalabildverkstan.se/test/wp-content/uploads/2016/10/dbv_logo.png');
       }
     });
    })(jQuery);
    
    jQuery(document).ready(function($) {
      $(window).scroll(function() {
        var scrollPos = $(window).scrollTop(),
            navbar = $('.x-navbar');
    
        if (scrollPos > 1100) {
          navbar.addClass('alt-color');
        } else {
          navbar.removeClass('alt-color');
        }
      });
    });
    
    #1292731
    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    .x-navbar.alt-color .x-brand img {
    width: 150px;
    }

    Hope it helps.

    #1294057
    dbv
    Participant

    Hi,

    Sorry, no effect. The logo still the same size.

    #1294088
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

  • <script> jQuery(function($){ $("#no-reply-1292607 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>