# 禁用移动设备上的标题栏更改

**URL:** https://meta.discourse.org/t/disable-header-changes-on-mobile/377969
**Category:** Support
**Created:** [2025年八月9日 06:46 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969 "2025-08-09T06:46:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [2025年八月9日 06:46 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969/1 "2025-08-09T06:46:48Z")

</div>

在移动设备上，当我滚动到话题顶部时，导航栏/标题栏会包含菜单图标和其他元素，包括分类滑块/轮播。

当我滚动超过某个“阈值”时，它会变成包含话题名称，但这会破坏我的格式。我能否禁用此行为？我希望标题栏一直保持不变。

正常/好的标题栏：

 ![IMG_1772](https://global.discourse-cdn.com/meta/original/4X/1/3/4/1340997f6809e4b7735a3a5c0842be2076f84b33.png)

滚动/糟糕的标题栏：

 ![IMG_1773](https://global.discourse-cdn.com/meta/original/4X/3/c/a/3cafe063a2fece330223a218a4e896f1e7b2d62c.png)

奇怪的是，当我使用 `Chrome > Inspect` 时，我会得到一个不同且令人满意的行为：

滚动前：

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/5/9/8591a7b2512cddf0978211dd3999a2344eaf04b5.png)

滚动后：

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/e/b/9ebb2e84260b0fb851acf3c8cc54cddc897a3dab.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2025年八月9日 09:11 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969/2 "2025-08-09T09:11:27Z")

</div>

我认为这个组件可以帮到你

> [@Optional Mobile Title Header](https://meta.discourse.org/t/optional-mobile-title-header/104238?u=moin):
>
> discourse2Summary Optional Mobile Title Header makes the feature where the header switches to mobile title optional for both users and sites.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/optional-mobile-title-header-switch)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-optional-title-mobile-header](https://github.com/discourse/discourse-optional-title-mobile-header)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features When disabled per user prefs → interface: …

汉堡菜单按钮在你两个截图中的位置不一样，这让我觉得你在第二种情况下没有使用移动模式。

> [@alltiagocom](#):
>
> ![IMG_1772](https://global.discourse-cdn.com/meta/original/4X/1/3/4/1340997f6809e4b7735a3a5c0842be2076f84b33.png)  
> ![image](https://global.discourse-cdn.com/meta/original/4X/8/5/9/8591a7b2512cddf0978211dd3999a2344eaf04b5.png)

你可以在URL后面添加 `?mobile_view=1` 来获得移动视图。这样你也可以改进样式，并继续受益于显示标题的功能。

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [2025年八月9日 09:53 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969/3 "2025-08-09T09:53:27Z")

</div>

> [@Moin](#):
>
> I think this component could help you
> 
> > [@](#):
> >
> > discourse2 Summary Optional Mobile Title Header makes the feature where the header switches to mobile title optional for both users and sites. eyeglasses Preview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/optional-mobile-title-header-switch) hammer\_and\_wrench Repository Link [GitHub - discourse/discourse-optional-title-mobile-header: optionally allow user to opt out of topic tilte switch on mobile header](https://github.com/discourse/discourse-optional-title-mobile-header) open\_book New to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features When disabled per user prefs → interface: [[image]](https://global.discourse-cdn.com/meta/original/3X/6/6/6631e81baefb79177adbd041474190cffb938078.png) …

That’s exactly what I wanted. Thanks!

> [@Moin](#):
>
> The burger menu button is not in the same place in your two screenshots, which makes me think you didn’t use mobile mode in the second case.

I just went to the Inspect panel in Chrome and clicked the button to activate the mobile view. Why the menu shifted to the left, I have no clue…  
Sometimes that view is not very accurate, I noticed that.  
Thanks for the `?mobile_view=1` tip. Didn’t know that.  
I just want to add, for those who are not familiar with this (and it took me a while to revert back to normal), to go back just add `?mobile_view=0` like `https://example.com?mobile_view=0`

With the `?mobile_view=1` option, I noticed it would act crazy when it hit that point of switching to the topic’s title, but on mobile it didn’t. There’s maybe something weird when using a desktop browser.

As you can see from my screenshots, besides the messed up header, the slider with the categories is completely removed.

1 - Do you think that’s happening because the height of the header doesn’t adjust properly?  
2 - How can I create CSS that only applies when that change happens?

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [2025年八月9日 10:01 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969/4 "2025-08-09T10:01:52Z")

</div>

@Moin 使用您分享的 URL 技巧（未安装组件）检查移动版本时，我在主题顶部看到这个：

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/5/0/e50544b2b33ddf075849a45025f8b20051e3dc6a.png)

滚动时，我看到这个：

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/4/3/4431c4f6ccf77a023143dca872d1c116071b2533.png)

因此，它会完全移除带有 `class=\"wrap custom-categories-navbar\"` 的 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: [2025年九月8日 10:02 UTC](https://meta.discourse.org/t/disable-header-changes-on-mobile/377969/5 "2025-09-08T10:02:51Z")

</div>

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