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

    Hi, I’m trying to change the logo image to another image when user scrolls down the page, but it seems that the .header-scrolled class doesn’t appear in a header with custom pixel value. If I change the header size to predefined, for example slim, it works. Is this a bug or is it supposed to work like that?

    #680214

    Hey teme,

    Have you activated the header in Enfold > Header > Header Behaviour ?

    If it is still not working for you Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)

    Best regards,
    Vinay

    #680273

    Link and login info are attached to the private content field.

    #681082

    Hi,

    I added this code to your child theme’s functions.php:

    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).scroll(function() {    
        var scroll = $(window).scrollTop();
    
        if (scroll >= 50) {
            $("#header").addClass("header-scrolled");
        } else {
            $("#header").removeClass("header-scrolled");
        }
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    

    Best regards,
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.