tscanlin / tocbot

Build a table of contents from headings in an HTML document.
MIT License
1.37k stars 114 forks source link

How to scroll the page to a title of an article and highlight a title in the directory #308

Closed LiuYuYang01 closed 8 months ago

LiuYuYang01 commented 9 months ago

English:Hello boss, how can Tocbot. js achieve page scrolling to a certain title of an article and highlight a certain title in the directory? I see that Tocbot's official website has this effect, but I cannot find the corresponding API and implementation method. If the boss has time, I hope he can give some guidance

中文:你好大佬,Tocbot.js如何实现实现页面滚动到文章的某个标题,就让目录中的某个标题高亮选中,我看Tocbot官网有这个效果,但是对应的api以及实现方法我找不到。如果大佬有时间,希望能指点一二

tscanlin commented 9 months ago

The official website also has the API. Can you post and example so I can see where you are struggling?