Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

点击标题/文章后,滚动正文会导致侧边栏持续高亮最后的标题 #608

Closed
program-think-mirror opened this issue Aug 15, 2018 · 1 comment

Comments

@program-think-mirror
Copy link

program-think-mirror commented Aug 15, 2018

sidebar.gif

when I scroll on main page or click other title

The sidebar always focus the last title of an article

问题:点击标题/文章后,只要一滚动自动高亮最后一个标题,且保持不变

when I inspect element, CSS active class in sidebar don't change correctly!


expected behavior:

except.gif

虽然跟 #234 重复了,但是#234关闭了

like issue#234, but issue#234 is closed, the problem still exist

docsify version: 4.7.0 // 2018年8月14日从官方github上下载的

window.$docsify = {
    auto2top: true,
    subMaxLevel: 2,
    maxLevel: 2,
    coverpage: false,
    loadSidebar: true
}

I had read Document many times, search for issue, don't get any solution for this problem.

官方文档(英文)我认真读了好几遍了,搜索了issue也没发现解决办法

docsify也是最新的4.7版,配置完全照着官方文档走,为何侧边栏文章子标题无法正确地高亮

@program-think-mirror program-think-mirror changed the title siebar don't autofocus title when mainpage scroll 点击标题/文章后,只要一滚动就高亮最后一个标题,且保持不变 Aug 15, 2018
@program-think-mirror program-think-mirror changed the title 点击标题/文章后,只要一滚动就高亮最后一个标题,且保持不变 点击标题/文章后,滚动正文就高亮最后的标题,且保持不变 Aug 15, 2018
@program-think-mirror program-think-mirror changed the title 点击标题/文章后,滚动正文就高亮最后的标题,且保持不变 点击标题/文章后,滚动正文就持续高亮最后的标题 Aug 15, 2018
@program-think-mirror program-think-mirror changed the title 点击标题/文章后,滚动正文就持续高亮最后的标题 点击标题/文章后,滚动正文会导致侧边栏持续高亮最后的标题 Aug 15, 2018
@program-think-mirror
Copy link
Author

program-think-mirror commented Aug 15, 2018

找到问题的原因了,我修改了h1-h6的display属性

如果h1-h6的display不等于block,js不能正确地获取到标题在正文中的正确位置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant