fix: 修复桌面端文章目录没有自动滚动跟随的问题

- 添加 indexScrollBoxSelector 配置项,指向侧边栏滚动容器
- 添加 scrollSelector 和 scrollWrap 配置,确保滚动监听正常工作
- 设置 defaultExpanded 为 true,保持目录子项默认展开
- 修复目录高亮后无法自动滚动到可视区域的问题
This commit is contained in:
2026-01-22 16:25:36 +08:00
parent 0ae1472e79
commit a79329547b

View File

@@ -527,10 +527,14 @@ $author_desc = get_option('argon_sidebar_author_description');
$(document).headIndex({
articleWrapSelector: '#post_content',
indexBoxSelector: '#leftbar_catalog',
indexScrollBoxSelector: '#leftbar_part2_inner',
scrollSelector: 'body,html',
scrollWrap: window,
subItemBoxClass: "index-subItem-box",
itemClass: "index-item",
linkClass: "index-link",
offset: 80,
defaultExpanded: true
});
});
} else {