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

Special characters break scroll behavior #4

Open
sirjamesgray opened this issue Jun 15, 2018 · 0 comments
Open

Special characters break scroll behavior #4

sirjamesgray opened this issue Jun 15, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@sirjamesgray
Copy link
Collaborator

Normally, clicking on Table of Contents (TOC) links scrolls to the position of the anchor link on the page.

When special characters exist in the TOC (parentheses, commas, etc) the page does not scroll to the anchor link position.

When these lines of code are disabled, this works properly:

nav-wiki/wiki.js

Lines 29 to 37 in 94fd819

// animating scroll behavior of anchor links
$(document).on('click', 'a[href^="#"]', function (event) {
event.preventDefault();
$('html, body').animate({
scrollTop: $($.attr(this, 'href')).offset().top
}, 300);
});

@sirjamesgray sirjamesgray added the bug Something isn't working label Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant