Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upScrollspy documentation regarding anchor class #28638
Open
Comments
|
It also doesn't appear to support nested UL/LI markup as well, <ul class "nav">
<li class="nav-item"><a href="#foo" class="nav-link">Foo</a></li>
<li class="nav-item"> <!-- this doesn't get the .active class when sub items are .active -->
<a href="#bar" class="nav-link">Bar</a>
<ul class="nav">
<li class="nav-item"><a href="#bar-a" class="nav-link">Bar A</a></li>
<li class="nav-item"><a href="#bar-b" class="nav-link">Bar B</a></li>
</ul>
</li>
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


OS: Fedora 29
Browser: Chrome
The Scrollspy documentation has a list of requirements to "activate" the feature. One requirement that appears to be missing is the presence of
class="nav-link"in all anchor tags in your nav component. I think this is important to mention, as it took quite a bit of trial and error to discover this while trying to enable scrollspy on an auto-generated nav component.