Try to scroll this page and look at the navigation bar while scrolling!
...
Example explained
Add data-spy=”scroll” to the element to be used as the scrollable region (often the <body> element).
Then set the data-target attribute to the id or class name of the navigation bar (.navbar). This is to ensure that the navbar is connected to the scrollable area.
Scrollable elements must match the ID of the links inside the navbar’s list items. For example, <div id=”section1″> matches <a href=”#section1″>.
The data-offset feature is optional and defines the number of pixels to offset from the top when computing the scroll position. This is handy if you believe that the links inside the navbar change the active state too quickly or too early when you navigate to scrollable items. Default is ten pixels.
Requires relative positioning: To function effectively, the element with data-spy=”scroll” must have the CSS position property set to “relative”.
Scrollspy Vertical Menu
---- SCROLL MUKAVU ----
In this example, we use Bootstrap’s vertical navigation pills for the menu: