Pro - Sticky Header - Does not Stick on Reload (Bug?)

With the sticky headers on my site, if I scroll down on the page and then hit reload, when the page reloads the sticky bar disappears. Once I scroll the sticky header reappears.

Bug?

(has it always been this way and I just noticed today?)

Hey @justinmking,

This is not a bug but rather not a feature yet. For now, please add this code in your Header JS.

(function($) {
	$(window).scroll(function() {
    
    var height = $(window).scrollTop();
    
		if (height > 50) {
			$('.hm1').addClass('.x-bar-fixed');
	  }
	}
})(jQuery);

Change hm1 with your bar’s class and adjust 50 to control how far you’d like the bar to show up.

Hope that helps.

Hmm, for some reason that code isn’t working - I did add an extra ) to address an error with the console.

Code -

(function($) {
$(window).scroll(function() {

var height = $(window).scrollTop();

	if (height > 90) {
		$('.hm1').addClass('.x-bar-fixed');
  }  })    })(jQuery);

(the bar’s class is .hm1 and .hm1.x-bar is also not working)

Hi There,

Your header is sticky on every page upon reloading many times.

Please let us know if you are still facing the issue and if you do let us know which browser and device you are using while experiencing the issue.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.