Fix Position of Header Booster theme

Tourist
14 0 1

Hi all!

I was looking for the way to fix the position of the header in my website, (now when scroll down all my homepage moves)

i tried some things but doesn´t work , can someone help me? thankss

 

Jhon

0 Likes
Shopify Partner
1878 315 400

Hi,

For that you must know how to code  in file.

follow this.

1. Go to online store->theme->edit code

2. Add bellow code in theme.liquid or them.js at bottom.

    var header= document.getElementsByTagName("header")[0];
    var sticky_class = header.offsetTop;
    $(window).scroll(function(){
      if ($(window).scrollTop() >= sticky_class ) {
        $('.site-header').addClass('fixed-header');
      }else {
        $('.site-header').removeClass('fixed-header');
      }
    });

3. Add this css to theme.scss file at bottom

 .fixed-header{
     position: fixed;
     top: 0;
     width: 100%;
  }

Let me know if cant work or affect any code.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Tourist
14 0 1

Thank you for your answer!, i put the codes when you said me but it seems that nothing happens, i wanted say too that i would like fix in the mobile version too, and i think they are different headers, but not sure , thankss

0 Likes
Highlighted
Shopify Partner
1878 315 400

Send me your store url i will check

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Tourist
14 0 1

markusdayan.com 

 

thanks

0 Likes
Shopify Partner
1878 315 400

Where you have added this code, because i can not debug without added code.

So let me know

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Tourist
14 0 1

I put the code already ,you should be able to see now in my theme.liquid and them.scss  

 

Thanks

0 Likes
Tourist
14 0 1

Can you see the code, or do you need i put here?? Thankss

0 Likes
Tourist
3 0 1
Hello friend do you exchange your theme for the Booster 2.2.3 theme?
1 Like