-
AuthorPosts
-
December 15, 2020 at 3:40 pm #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?
- This topic was modified 4 years ago by MENS.
December 20, 2020 at 3:43 am #1268708Hey 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,
MikeDecember 23, 2020 at 3:30 pm #1269550This reply has been marked as private.December 24, 2020 at 12:35 am #1269687Hi,
Thank you for the login, but it is not admin so I can’t see the theme or WordPress options.Best regards,
MikeDecember 24, 2020 at 10:04 am #1269724Hi sorry Mike, i’ve changed it to Administrator.
December 24, 2020 at 1:37 pm #1269749Hi,
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,
MikeDecember 24, 2020 at 3:07 pm #1269756This reply has been marked as private.December 26, 2020 at 5:06 pm #1269829Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.