fix: 让直达评论区按钮始终显示

This commit is contained in:
二叉树树
2026-01-21 23:00:56 +08:00
parent de297867fc
commit 80c05832f4

View File

@@ -534,7 +534,7 @@ function scrollFunction() {
if (goToCommentsBtn) {
// Only show if comments exist and scrolled down
const commentsExist = !!document.getElementById('giscus-container');
if (commentsExist && (document.body.scrollTop > bannerHeight || document.documentElement.scrollTop > bannerHeight)) {
if (commentsExist) {
goToCommentsBtn.classList.remove('hide')
} else {
goToCommentsBtn.classList.add('hide')