gfranko / jquery.tocify.js

A jQuery Table of Contents plugin that can be themed with Twitter Bootstrap or jQueryUI.
http://gregfranko.com/jquery.tocify.js/
MIT License
928 stars 216 forks source link

highlightDefault not working when there is content above the ToC #78

Open maknoon opened 9 years ago

maknoon commented 9 years ago

Hey, quick question about how to keep the first element of the ToC "unhighlighted" when I am scrolling through some sections that are placed above the ToC?

For example, here is my navigation sidebar:

As far as I understand, when the ToC is init and with highlightDefault = true, H1 will be highlighted, even while user is viewing section 1 and section 2 in the main frame. However when I set highlightDefault = false, the subheaders disappear entirely. How do I make H1 remain "unhighlighted" until the user scrolls to that portion of the page?

Thanks!

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ztmsimon commented 7 years ago

这个插件的说明太少了,无法做到导航处的高亮,不知道如何只设定在页面中间,不要顶到最上。