Hello! Love this theme – just need a little help achieving something.
I have made the header on a website semi-transparent and also shrink.
I have told the header that once it has shrunk to please have an opaque white background.
My only block is I don’t know how to tell the mid shrink header to have a fully opaque white background so I can’t see the website through it while it is shrinking. Is this possible?
Hey Briana,
Here is the code you can put in functions.php in child theme:
add_action('wp_footer', 'ava_new_custom_script');
function ava_new_custom_script(){
?>
<script type="text/javascript">
(function($) {
var lastScrollTop = 0;
var target = $(".container.av-logo-container");
$(window).on('scroll', function() {
st = $(this).scrollTop();
if(st < lastScrollTop) {
if (st <= 2) {
target.css("background-color", "rgba(255, 255, 255, 0.5)");
}
}
else {
target.css("background-color", "#fff");
}
lastScrollTop = st;
});
})(jQuery);
</script>
<?php
}
Also you might want to pay attention to the header on mobile, the logo seems to be too big.
If you need further assistance please let us know.
Best regards,
Victoria
This is absolutely perfect! Exactly what I wanted :D
Enfold support is the best. And yes the mobile logo definitely needs adjusting – thanks for letting me know :)
Thank you!
You can close this ticket.