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

Tocify alternative #96

Open tscanlin opened 8 years ago

tscanlin commented 8 years ago

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.

ztmsimon commented 7 years ago

加油!

ztmsimon commented 7 years ago

大哥,tocbot-master这个下载里面没有tocbot.js、tocbot.css啊? 能否搞简单点啊?

tscanlin commented 7 years ago

If you check the releases page there are compiled files: https://github.com/tscanlin/tocbot/releases

jeremylynch commented 7 years ago

@tscanlin is this a fork of tocify? Do you have migration steps? Thanks

tscanlin commented 7 years ago

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',
});