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

Clicking on menu items that scroll to near the bottom of the document highlight the wrong menu item #1

Open
brendanheywood opened this issue Feb 28, 2012 · 1 comment

Comments

@brendanheywood
Copy link

Test case:

http://projects.jga.me/toc/#toc0

Click on any menu item that refers to an item that is within one page height of the bottom of the document, so on my screen these include History down to Contributions. It then smooth scrolls down to this item, but then when the menu highlight code kicks in it detects that it is only up to the Example CSS section which is the first section visible on the page.

I'd just test if the page bottom was hit as part of the scroll and if so explicitly set the menu item to highlight the on that was just clicked and not do the current location detection.

@jtwalters
Copy link

I experience the same issue on the link you referenced—the highlightOnScroll option often highlights the wrong item.

+1 on your proposal to detect hitting page-bottom and override the highlightOnScroll feature in that case.

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

2 participants