# “docked”在\<body\>中总是存在吗？

**URL:** <https://meta.discourse.org/t/docked-in-body-always-present/216806>\
**Category:** Bug\
**Created:** [2022年二月2日 06:54 UTC](https://meta.discourse.org/t/docked-in-body-always-present/216806 "2022-02-02T06:54:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [2022年二月2日 07:07 UTC](https://meta.discourse.org/t/docked-in-body-always-present/216806/2 "2022-02-02T07:07:33Z")

</div>

这可能对您有帮助：

> [@Header scroll shadow](https://meta.discourse.org/t/header-scroll-shadow/198021/4?u=dodesz):
>
> You can add something like to the header tab of your theme \<div class="header-anchor"\>\</div\> \<script type="text/discourse-plugin" version="0.8"\> if (!"IntersectionObserver" in window) return; const { on } = require("discourse-common/utils/decorators"); const stickyClass = "sticky"; api.modifyClass("component:site-header", { @on("didInsertElement") stickyHeaderCheck() { const anchor = document.querySelector(".header-anchor"); const header = this.element; new IntersectionObse…

> [@Logo in docked header bar](https://meta.discourse.org/t/logo-in-docked-header-bar/216199/2?u=dodesz):
>
> Hello I think you can use for this @Johani 's fantastic solution. Something like this arrow_double_down Create a new component and add the following. Header section \<div class="header-anchor"\>\</div\> \<script type="text/discourse-plugin" version="0.8"\> if (!"IntersectionObserver" in window) return; const { on } = require("discourse-common/utils/decorators"); const stickyClass = "sticky"; api.modifyClass("component:site-header", { @on("didInsertElement") stickyHeaderCheck() { c…

> [@adundovi](#):
>
> 现在，不幸的是，这个类失去了它的目的：您可以完全删除它，并删除 [lines contain](https://github.com/discourse/discourse/search?q=not%28.docked%29&type=code) `not(.docked)`

您提到的这个 `.docked` 与 `.topic-progress-wrapper` 不同。  
当这个 ⏬ 出现时：

 ![Screenshot 2022-02-02 at 8.01.50](https://global.discourse-cdn.com/meta/original/3X/4/5/451d0a4cf1aa76cbac74d25d8343d28f50cd621c.png)

停靠在主题底部。

---

_[View the full topic](https://meta.discourse.org/t/docked-in-body-always-present/216806)._
