Sticky Bar not Sticking in Front-end (works fine in Cornerstone)

I have a sticky bar that I’ve positioned underneath a Hero Bar. Everything behaves exactly as expected within Cornerstone. However, when viewing the site, the sticky bar just scrolls along by and doesn’t stick.

I’ve investigated caching and played around with the sticky bar, but no solution yet. Could you help?

I have the latest stable release of WP and Pro.

I have the same problem, unfortunately.

There’s a couple of sticky bar issues that will be fixed on Monday. Apologies we had to have an early release with the WP 6.2 issue. Try the following as a workaround for now. I’m just trying to trigger a resize event through body height.

window.addEventListener("load", function() {
  window.document.body.style.height = "1000px";
  setTimeout(function() {
    window.document.body.style.height = "auto";
  }, 250);
});

Thanks. The code makes the bar sticky. However, it does not respect the initial margin set.

My first bar is the Hero Bar, which takes up almost 100vh. Then my second bar is the sticky bar. Using the JS you provided, the sticky bar sticks to the top right away, it does not stay below the hero bar.

Hey @thomasgeorge,

You can try changing the height value of 1000px to fit your needs. As our developer said, there will be an update about the sticky bar issues. It would be best to stay tuned for the latest updates.

Thank you for understanding.

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