Bootstrap 4 tutorial

Components(12): Scrollspy: Example with nested nav

About this demo

Scrollspy demo using three-level nested Navigations.

  • Container div.container
    • Left div.col-4.col-lg-3
      • Navigation nav.nav.nav-pills.flex-column
        • Attribute id="scrollspy-demo"
        • Item a.list-group-item
          • Attribute href="#{position-id}"
        • Or nested navigation nav.nav.nav-pills.flex-column
          • ( id is not required for inner navs)
          • Item a.list-group-item
            • Attribute href="#{position-id}"
            • Indent .ml-(4|5) (⇒ Spacing )
          • Can be nested any levels
    • Right div.col-8.col-lg-9 - Scrolling contents (here)
      • Attribute data-spy="scroll"
      • Attribute data-target="#scrollspy-demo"
      • Attribute data-offset="10" (⇒ Note )
      • Style style="height: 32rem; overflow-y: scroll;"
      • Scrolling elements
        • Set id="{position-id}" to the tracking targets

Below are dummy scrolling contents. Each heading have a specific id="{position-id}" for scroll tracking.

Pictures

Picture 1

Picture 1-1
Picture 1-2
Picture 1-3

Picture 2

Picture 2-1
Picture 2-2
Picture 2-3

Slides

Slide 1

Slide 2

Slide 3