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

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

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

正常/好的标题栏:

滚动/糟糕的标题栏:

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

滚动前:

滚动后:

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

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

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

1 个赞

That’s exactly what I wanted. Thanks!

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?

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

滚动时,我看到这个:

因此,它会完全移除带有 class=\"wrap custom-categories-navbar\" 的 div。看来这里还有更多需要解决的问题,需要另一种方法来防止类别滑块消失。

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