Open tscanlin opened 8 years ago
加油!
大哥,tocbot-master这个下载里面没有tocbot.js、tocbot.css啊? 能否搞简单点啊?
If you check the releases page there are compiled files: https://github.com/tscanlin/tocbot/releases
@tscanlin is this a fork of tocify? Do you have migration steps? Thanks
No it's not a fork, it is totally separate.
The most important part is to just be sure you initialize the script with the proper selectors:
tocbot.init({
// Where to render the table of contents.
tocSelector: '.js-toc',
// Where to grab the headings to build the table of contents.
contentSelector: '.js-toc-content',
// Which headings to grab inside of the contentSelector element.
headingSelector: 'h1, h2, h3',
});
Since Tocify hasn't been updated in 3 years and I needed similar functionality but didn't want to depend on jquery or jquery UI, I have created Tocbot which uses native DOM methods. You can check it out here: http://tscanlin.github.io/tocbot/
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.