I am trying to use affix component in latest version of twitter bootstrap by following documented steps and I can’t get it work. Here is the example in JsFiddle
I see two problems
- Clicking sidenav links scrolls correctly to appropriate content, but scrolling content doesn’t make appropriate sidenav link active
- The sidenav is not styled as in bootstrap website.
I would appreciate if someone helps to get this working as in twitter bootstrap site.
You are looking for a ScrollSpy. It highlights a menu item as you scroll or switch to the appropriate section.
Affix is in some way alternative to experimental CSS
position:sticky. What it does that changes menupositionfromstatictofixedas you scroll n px from the top.