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
927 stars 217 forks source link

Feature Request: "Scooting" of ToC as Page Scrolls #49

Open lord opened 10 years ago

lord commented 10 years ago

It seems that if the table of contents is longer than the height of the page, it will have a scrollbar, so that works! But sometimes you'll scroll down on the main page, and the currently selected ToC item will be outside of the visible part of the ToC...it's still there, it's just hidden because the ToC div is scrolled above it. This means that sometimes you'll scroll down a ways and suddenly there will be no visibly selected ToC item, which can be confusing.

Dropbox has a solution: with Dropbox's API docs on a smallish browser window, if you scroll way down you can see that the scrolling table of contents on the left scrolls so that the currently active item is always visible when it is scrolled to.

If you'd like, I can make a small example that demonstrates the issue.

So yea, an option that automatically scrolls the table of contents (when necessary) so that a newly activated ToC item is always visible would be awesome!

Thanks again for the awesome plugin!

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

gfranko commented 10 years ago

I agree that this should be added. I'll add it in the next release!

xyzones commented 10 years ago

@gfranko when are you planing the next release? That would be nice to have.

gfranko commented 10 years ago

@xyzones Good question. I will try and and do a release within the next two weeks.