# Ajout d'un en-tête dans le thème qui perturbe la barre de progression du sujet (lorsqu'il est ancré)

**URL:** <https://meta.discourse.org/t/adding-header-in-theme-messes-up-topic-progress-bar-when-docked/97393>\
**Category:** Product Support\
**Created:** [Septembre 17, 2018, 6:44 UTC](https://meta.discourse.org/t/adding-header-in-theme-messes-up-topic-progress-bar-when-docked/97393 "2018-09-17T18:44:58Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [Septembre 25, 2018, 1:52 UTC](https://meta.discourse.org/t/adding-header-in-theme-messes-up-topic-progress-bar-when-docked/97393/7 "2018-09-25T01:52:56Z")

</div>

Thanks @Lew_Grothe, I do see the issue now. There are two lines of code that cause this when using a theme header, first:

```plaintext
const maximumOffset = $("#topic-bottom").offset().top + progressHeight;

```

`offset.top` here gets the element’s position from the top of the _document_. Later in the code, the position of the progress bar is calculated based on the height of `#main` minus said offset:

```plaintext
const bottom = $("#main").height() - maximumOffset;

```

But when adding an element to the body before `#main`, the offset will be misaligned with `#main`. I will prepare a PR tomorrow and propose to target the `body` element, as you suggest, it makes sense to me.

---

_[View the full topic](https://meta.discourse.org/t/adding-header-in-theme-messes-up-topic-progress-bar-when-docked/97393)._
