# Stick header in proper scroll position when having a custom fixed topbar on top of it

**URL:** <https://meta.discourse.org/t/stick-header-in-proper-scroll-position-when-having-a-custom-fixed-topbar-on-top-of-it/72873>\
**Category:** Product Support\
**Created:** [Outubro 26, 2017, 8:08pm UTC](https://meta.discourse.org/t/stick-header-in-proper-scroll-position-when-having-a-custom-fixed-topbar-on-top-of-it/72873 "2017-10-26T20:08:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cfviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cfviotti/32/120609_2.png) [@cfviotti](https://meta.discourse.org/u/cfviotti)\
**Post date:** [Outubro 26, 2017, 8:08pm UTC](https://meta.discourse.org/t/stick-header-in-proper-scroll-position-when-having-a-custom-fixed-topbar-on-top-of-it/72873/1 "2017-10-26T20:08:53Z")

</div>

We’re having trouble with a custom Discourse instance running inside a Django revproxy application ([https://dev.edemocracia.labhackercd.net/expressao/](https://dev.edemocracia.labhackercd.net/expressao/)).

In this application we have a global topbar that is always sticked to the top of the page with a non sticked wrapper that has a height of 24px set (in order to “push” the site content).  
When we scroll this page, the ‘#main’ top offset is then initially different from 0 now, so only after scrolling 24px it will stick by appling the ‘.docked’ class to the body. But since our global topbar is fixed, we’d like to apply the ‘.docked’ class and stick the Discourse header when the ‘#main’ offset is 24px instead of 0, in order to not overlay our bar on top of the header.

How should I approach this issue? Can I customize some of Discourse’s JS? Maybe just inject new JS code to override the default behaviour?

---

_[View the full topic](https://meta.discourse.org/t/stick-header-in-proper-scroll-position-when-having-a-custom-fixed-topbar-on-top-of-it/72873)._
