Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub Sections not detected properly #38

Open
Bitfiddler opened this issue Jun 22, 2017 · 1 comment
Open

Sub Sections not detected properly #38

Bitfiddler opened this issue Jun 22, 2017 · 1 comment

Comments

@Bitfiddler
Copy link

Bitfiddler commented Jun 22, 2017

Based on the docs and looking at the source on the docs webpage, I tried to create the most simple example and I am running into a problem where the TOC is not tracking the links and activating/deactivating the current heading that is visible on screen:
http://plnkr.co/edit/NFPJEZX45jElRDqCC6pP?p=preview

What am I doing wrong?

@Bitfiddler
Copy link
Author

Bitfiddler commented Jun 22, 2017

Ok, so after much debugging, the reason is Chrome. Perhaps adding the following comment to the docs may save others HOURS of time.

You MUST put:
<!DOCTYPE html>
at the top of your html document otherwise Chrome will report the visible height of the window to be the same as the document height. This causes the plugin to think it is at the bottom of the document and so shows only the last TOC menu item as being permanently active.

I have updated the above plunkr sample to have the full set of minimal requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant