Hi there,
Can I make a logo also sticky when the menu is above the logo? And can I make the menu background color change when srolling?
Please take a look at:
Thanks in advance!
Best regards, Annelies
Hi Annelies,
Sorry for the late reply, I’m not 100% sure I understand what you mean by that. Could you try to explain a bit further what you are looking to achieve and/or post screenshots highlighting your intentions please?
Thanks,
Rikard
Hi Rikard,
Sorry for the minimal explanation ;-)
In private content I have the screenshots for you.
Best regards, Annelies
Hi,
Thank you for the detailed explanation. Please try this in the functions.php file:
// custom script
function add_custom_script(){
?>
<script>
(function($){
function g() {
var scrolled = $('.header-scrolled').length,
st = $(window).scrollTop();
if( st >= 99 ) {
$('.av-section-bottom-logo').insertAfter('#header_main');
$('.header_bg').css('background', '#ffffff');
} else {
$('.av-section-bottom-logo').prependTo('#main');
$('.header_bg').css('background', 'transparent');
}
}
function gh() {
var st = $(window).scrollTop();
if( st >= 99 ) {
$('.av-section-bottom-logo').insertAfter('#header_main');
$('.header_bg').css('background', 'transparent');
}
}
gh();
$(window).scroll(function() {
g();
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Remove browser cache or hard refresh before checking the page.
Best regards,
Ismael
Hi Ismael,
I figured it out, on a different way. Thanks for the hints ;-)
Best regards, Annelies
Hi,
glad you figured it out. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy