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

    Hi,

    I’ve a tranparant header with a centered logo. After scrolling i’ve removed the logo but the animation of the animation is not nice. Can i change this?

    Also the anchors are not correct. Is there a way to avoid this?

    scolled header
    anchor shift

    https://bramduijn.nl/

    • This topic was modified 3 years, 11 months ago by MENS.
    #1268708

    Hey Jasper,
    Sorry for the very late reply and thanks for the link, I see that on scroll your large logo is flashing while it moves to the small logo position. But due to your caching, I’m having trouble isolating your custom css, can you please post it and disable it from your site. I can test by injecting it via the browser. Or you could include admin login in the Private Content area so I can test, if you don’t mind.
    As for your anchors, I believe the images are being lazyloaded so as the page is scrolled the images show and take their height increasing the height of the page causing the anchors to miss.
    To test this try disabling the lazyload option in the theme options. Please also disable any caching & minifying plugins while testing. Then clear your browser cache and check.

    Best regards,
    Mike

    #1269550
    This reply has been marked as private.
    #1269687

    Hi,
    Thank you for the login, but it is not admin so I can’t see the theme or WordPress options.

    Best regards,
    Mike

    #1269724

    Hi sorry Mike, i’ve changed it to Administrator.

    #1269749

    Hi,
    Thank you, I noticed that your logo was off-center so I uploaded a new one so I could continue with the css changes.
    I then added this css:

    @media only screen and (min-width: 989px) { 
    	#top #header.av_header_transparency.av_alternate_logo_active .logo > a > img {
    		 min-width: 100px !important;
    		 opacity: 1 !important;
    	}
    	#top #header.av_header_transparency.av_alternate_logo_active .logo > a > span > img.alternate {
    		 opacity: 0 !important;
    	}
    }
    

    This seems much smoother now, please clear your browser cache and check.

    Best regards,
    Mike

    #1269756
    This reply has been marked as private.
    #1269829

    Hi,
    Sorry for the late reply, I was not able to determine the cause for this but I was able to create a work-around, I added this script to your child theme functions.php:

    function custom_script() { ?>
        <script>
    (function($) {
      $('a[href*="#"]:not([href="#"])').click(function() {
          var target = $(this.hash);
    	  var width = $(window).width();
    	  if ( width >= 1024) {
            $('html,body').stop().animate({
              scrollTop: target.offset().top - 100
            }, 'linear'); 
    	  }
      });    
    	
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    This only works on screens wider than 1024px, and adjusts the offset based on anchor clicks. The primary target is desktop devices.
    Please note that if you test this script on a desktop device, resized to a mobile view, you will need to reload the page to test, actual mobile devices will not load the script correctly.
    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.