Skip to content

Added a listener for using an offset for fixed navbars #12

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pimwillems
Copy link

Reason for modification

We've added an offset variable to use if you have a fixed navbar. Otherwise the active indicator responds the page top which is underneath the fixed navbar.

How to use / Code example

You can use fixedNavbarOffset to indicate an amount of pixels calculated from the top.

var spy = new ScrollSpy('#js-scrollspy', {
    nav: '.js-scrollspy-nav > a',
    className: 'is-inview',
    fixedNavbarOffset: 170,
    callback: function () {
      $(".name-navigation a").blur();
    }
  });

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

Successfully merging this pull request may close these issues.

1 participant