the top bar including logo stays sticky whenever I scroll up and down the page.
Acutally I wanna make it sticky only when I scroll up and not sticky when scroll down the page.
if it’s not possible then I just wanna remove sticky feature.
the top bar including logo stays sticky whenever I scroll up and down the page.
Acutally I wanna make it sticky only when I scroll up and not sticky when scroll down the page.
if it’s not possible then I just wanna remove sticky feature.
There is no setting to remove the sticky header – it’s a fundamental part of Discourse.
You could disable the stickiness by creating a theme and adding this to your CSS:
.d-header {
position: relative;
}
This may impact the layout in other ways and cause issues with the dropdown menus, so you’d need to write some additional CSS to get around those problems. Getting started with themes: Structure of themes and theme components.
There are also a lot of additional topics that might help you with general Discourse questions in the howto category.
Привет, мне интересно, какие именно проблемы могут возникнуть? Я отключил правило position: fixed через инструменты разработчика, чтобы поэкспериментировать. Я попробовал поработать с меню, и всё кажется работающим нормально.
Я заметил, что высота заголовка может иметь значение при прокрутке, но пока не уверен, какие именно последствия это влечёт.
topictimeline: discourse/app/assets/javascripts/discourse/app/widgets/topic-timeline.js at 9482ddff7343d2e913a5177d2cdef100140b57f2 · discourse/discourse · GitHub
keyboardshortcuts:
discourse/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js at 350fe932cafa2874e5fd87b4d401223754158656 · discourse/discourse · GitHub
offset calculator: discourse/app/assets/javascripts/discourse/app/lib/offset-calculator.js at 7a2e8d3ead63c7d99e1069fc7823e933f931ba85 · discourse/discourse · GitHub
Я также пробовал установить position: relative, но тогда сверху страницы появляется пустое пространство, а position: absolute работает нормально.
P.S.: Я знаю, что липкий заголовок для вас очень важен. Раньше я был с ним согласен, но сейчас я в длительном отпуске на Тайване и вынужден целый день работать на крошечном экране ноутбука. Я удалю его в компоненте темы. Извините, но мне это необходимо. От этого у меня кружится голова ![]()
Возможно, связанных проблем нет, но мы редко видим, чтобы сайты делали что-то подобное, поэтому это не было протестировано так же тщательно, как поведение по умолчанию.