Make top nav bar fixed on scroll

Hello,

I’m trying to make this top nav bar fixed on scroll, but can’t seem to find the right CSS.

I’ve tried to find the right answer in the forum, but get different answers.
Thanks for any help.

Hey Justin,

Thanks for writing in!

To resolve your issue and make the topbar sticky, please add this JS code in the Theme Options > Global JS (http://prntscr.com/evswzb)

(function($) {
  $('.x-logobar').prependTo('.x-navbar');
  $('.x-topbar').prependTo('.x-navbar');
})(jQuery);

We would love to know if this has worked for you. Thank you.

Thank you. It seems to be cutting off the banner at the top. Do i need to lower that section below the nav menu?

Hello Justin,

Now that the topbar and logobar where in the same container as the navbar, please go to X > Theme Options > Header > Navbar and set the Navbar Top Height to 290 because this is now the total height of the navbar. This should resolve the banner issue that has been cut off.

Please let us know how it goes.

Thanks so much for your help

You are most welcome!

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