# 自定义页眉链接在滚动主题页面内容时自动隐藏

**URL:** https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297
**Category:** Support
**Created:** [2021年三月15日 13:15 UTC](https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297 "2021-03-15T13:15:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![narayanan](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@narayanan](https://meta.discourse.org/u/narayanan)
#### Post date: [2021年三月15日 13:15 UTC](https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297/1 "2021-03-15T13:15:28Z")

</div>

你好，

我创建了一个“自定义标题链接”组件并将其添加到我的主题中。该组件在站点上已正确显示。随后，我导航到任意主题页面，标题栏显示如下：

 ![UpdatedDiscourseHeaders](https://global.discourse-cdn.com/meta/original/3X/5/2/52062dc3ba1dda821e83dea92a33edcf1fda84de.png)

在滚动页面时，其中一个自定义标题菜单“资源”自动隐藏了。我推测这可能是由于标题栏自动显示主题标题所致，如下所示：

 ![HideResourcesScroll](https://global.discourse-cdn.com/meta/original/3X/2/7/27bcb81d086ac4220d51f73aba8069ee91366235.png)

向上滚动后，主题标题从标题栏中消失，“资源”菜单也恢复正常显示。

**如何覆盖滚动时自动隐藏标题菜单的行为？**

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2021年三月17日 01:58 UTC](https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297/2 "2021-03-17T01:58:32Z")

</div>

该组件中的设置按如下方式工作：

> [@Johani](#):
>
> `链接文本，链接标题，URL，视图，目标，滚动时隐藏`
> 
> **链接文本：** 链接显示的文本。  
> **链接标题：** 鼠标悬停在链接上时显示的文本。  
> **URL：** 链接的路径（可以是相对路径）。  
> **视图：** vdm = 桌面和移动设备，vdo = 仅桌面，vmo = 仅移动设备。  
> **目标：** blank = 在新标签页中打开，self = 在同一标签页中打开。  
> **滚动时隐藏：** remove = 在主题页面标题展开时隐藏链接，keep = 即使在主题页面标题可见时也保持链接可见。

您是否将设置的最后一部分设为 `remove`？您需要将其更改为 `keep`。

---

<div class="post-metadata">

### Author: ![narayanan](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@narayanan](https://meta.discourse.org/u/narayanan)
#### Post date: [2021年三月17日 07:11 UTC](https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297/3 "2021-03-17T07:11:35Z")

</div>

没问题，谢谢！👍

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2021年四月16日 07:11 UTC](https://meta.discourse.org/t/custom-header-links-was-automatically-hide-when-scrolling-topic-page-contents/183297/4 "2021-04-16T07:11:50Z")

</div>

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