Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #775763

    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?

    #775974

    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

    #776375

    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.

    #776482

    Hi,

    Great, glad we could help and thanks for the kind words :-)

    Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Color of header during shrink transition’ is closed to new replies.