Okay
  Public Ticket #2000584
Static header while scrolling
Closed

Comments

  • René Hildebrand started the conversation

    Is there an option to have the header always static with a border-line which separates it from the content (like in the screenshot) and will stay there (or shrinks a little bit) in front of the page content while scrolling ? 

  •  675
    Neuron replied

    Hi Rene,

    Well, for the sticky option we use two headers, one for normal and one for sticky, so they swap quickly. You can create both headers with template and assign them to the page settings or the customizer, you can reduce their height as you wish.

    But, if you want to keep the same header sticky all the time, then disable the sticky option and enter the following Custom CSS.

    .l-primary-header--default-wrapper {
        position: fixed;
        left: 0;
        width: 100%;
        top: 0;
    }

    To reduce the size after scroll, first install the following plugin, it will allow you to place scripts. https://wordpress.org/plugins/insert-headers-and-footers/

    Add the following script in head or footer on the settings of plugin.

    <script>
    $(document).ready(function(){
        $(window).scroll(function(){
            if ($(window).scrollTop() > 100){
                $('.l-primary-header--default-wrapper').css('height', '50px');
            }
        });
    });
    </script>

    To add bottom border, simply add.

    .l-primary-header--default-wrapper {
        border-bottom: 1px solid #f3f2f1;
    }

    Feel free to ask for anything you need.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • evananya replied

    Hi, this worked great on desktop but the changes do not apply to mobile. How can I fix?

  •  675
    Neuron replied

    Good to know, you are welcome anytime, feel free to ask for anything you needsmile.png

    If you like our theme, please leave us a rate with 5 stars at ThemeForest, that would help us a lot.

    Well, the mobile menu is different and it has a different selectors. The selector is the below:

    .l-primary-header--responsive-wrapper

    Kind Regards,
    NeuronThemes


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.