Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1156447

    Hi! I’ve changed the size of transparant logo and that works perfect, but when you scroll down the logo is for 1 sec being smaller before it shows the default logo.

    This is the css code i’m using:

    #top .av_header_transparency.av_alternate_logo_active .logo {
    height: 200%;
    width: auto;
    overflow: visible;
    }

    Tried without #top but also didn’t work.

    Any ideas? See link in private data to see what I mean!

    #1156504

    Hey jannnnnneke,
    Perhaps this will help, Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_logo_script(){
      ?>
      <script>
    (function($){
    $(window).load(function(){
    $(window).scroll(function() {
      var scroll = $(window).scrollTop();
      if (scroll >= 1) {
       $('.logo .subtext img.alternate').hide();
      } else {
       $('.logo .subtext img.alternate').show();
      }
     });
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_logo_script');

    Best regards,
    Mike

    #1156523

    Hi Mike!

    Thanks! It helps, only when I scroll back to top the main logo is getting bigger before you see the transparent logo. See link!

    #1156538

    Hi,
    So it is working only when scrolling down, correct?
    I tried adjusting for the scroll back up, but I will have to research more and perhaps try something else.
    Try removing it and changing your css to this:

    #header.av_header_transparency .logo img.alternate {
        height: 175%;
        max-height: 350px;
        overflow: visible;
    }

    Otherwise please include an admin login in the Private Content area, so I can test when I find a new solution.

    Best regards,
    Mike

    #1156539

    I think it’s working, only the overflow is not visible. The logo is the same as the main logo but than with text onder the flower. The text is not visible right now.

    I’ve created admin login for you! Thanks a lot!

    #1157184

    Hi,
    Thank you for the login, I commented out your css and adjusted the function to this:

    function custom_logo_script(){
      ?>
      <script>
    (function($){
    $(window).load(function(){
    	$('#header.av_header_transparency #header_main .av-logo-container .inner-container').css({ 'height': '175%' });
    $(window).scroll(function() {
      var scroll = $(window).scrollTop();
      if (scroll >= 5) {
      	$('#header.av_header_transparency #header_main .av-logo-container .inner-container').css({ 'height': '100%' });
       $('.logo .subtext img.alternate').attr("src","https://lnsc.nl/lnsc2020/wp-content/uploads/Logo-LNSC2020-240.png");
     } else if (scroll <= 5){
     	$('#header.av_header_transparency #header_main .av-logo-container .inner-container').css({ 'height': '175%' });
       $('.logo .subtext img.alternate').attr("src","https://lnsc.nl/lnsc2020/wp-content/uploads/Logo-LNSC-2020-240.png");
       
     } else {
     	$('#header.av_header_transparency #header_main .av-logo-container .inner-container').css({ 'height': '175%' });
       $('.logo .subtext img.alternate').attr("src","https://lnsc.nl/lnsc2020/wp-content/uploads/Logo-LNSC-2020-240.png");
       
      }
     });
    });
    })(jQuery);
    
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_logo_script');

    result:
    via GIPHY

    please clear your browser cache and check.

    Best regards,
    Mike

    #1159071

    Thanks! But it’s still not working fine when you scroll up. Than the default logo is getting bigger in one split second. I cant see your gif anymore and dont know how to send you a video of my internet browser.. The rest is perfect!

    #1159481

    Hi,
    I tried adjusting again, with this solution I added a little fade animation to hide the transformation,
    this is the new functions.php code:

    function custom_logo_script(){
      ?>
      <script>
    (function ($) { 
      $(window).scroll(function() {    
          var scroll = $(window).scrollTop();
          if (scroll >= 1) {
              $("#header").addClass('scrolled');
          } else {
             $("#header").removeClass('scrolled');
          }
      });
      })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_logo_script');

    this is the new css:

    #header.av_header_transparency #header_main .av-logo-container .inner-container {
    height: 175% !important;
    overflow: visible;
      animation-name: fadeInOpacity!important; 
      animation-timing-function: ease-in !important; 
      animation-duration: 1.5s!important; 
    }
    #top #header.scrolled img.alternate{
            -webkit-animation-name: slideDown;
            -webkit-animation-timing-function: ease-out;
            -webkit-animation-duration: 0.5s;
            -webkit-animation-iteration-count: 1;
            -webkit-animation-fill-mode: forwards;
     
    }
    @keyframes fadeInOpacity {
      0% {
        opacity: 0;
      }
      100% {
        opacity: 1;
      }
    }
    @keyframes slideDown{
      from {
        transform: translateY(-100%);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 0;
      }
    }

    please clear your browser cache and check.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.