Skip to content

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

Open
pimwillems wants to merge 1 commit intomakotot:masterfrom
Maerschalk:master
Open

Added a listener for using an offset for fixed navbars#12
pimwillems wants to merge 1 commit intomakotot:masterfrom
Maerschalk:master

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