Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #683523

    Hi,

    Where can I change the point where the class “header-scolled” is added to the header? In my example I set

    .html_header_top.html_header_sticky .header-scrolled { display:none;}

    Actually the the header disappears after the user begins to scroll down (Enfold theme adds the class “header-scrolled” to the header-Tag). I want it that the class is added after the user scrolls down X Pixel. Or 100% of the display height for example (where my first section width height:100% ends).

    Thanks,
    Marcel

    • This topic was modified 8 years, 2 months ago by Mathuseo.
    #684851

    Hey Marcel!

    Thank you for using Enfold.

    Use the script provided in the following thread then adjust the scroll position value (50). https://kriesi.at/support/topic/header-scrolled-class-not-available-in-header-with-custom-pixel-value/#post-681082

    UPDATE: Use this code:

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

    Best regards,
    Ismael

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