Scrollspy demo using three-level nested Navigations.
div.container
div.col-4.col-lg-3
nav.nav.nav-pills.flex-column
Attribute
id="scrollspy-demo"
a.list-group-item
Attribute
href="#{position-id}"
nav.nav.nav-pills.flex-column
id
is not required for inner navs)a.list-group-item
Attributes
href="#{position-id}"
.ml-(4|5)
(⇒ Spacing )div.col-8.col-lg-9
- Scrolling contents (here) Attributes
data-offset="10"
(px) for adjusting scrolling position calculation. Ideally, it should be "0"
. But it sometimes causes a problem that it does not activate a pill when a use click a pill to scroll the page (possibly by numerical errors). Setting an offset around "10"
results to natural behaviors.Below are dummy scrolling contents. Each heading have a specific id="{position-id}"
for scroll tracking.