I have asked a previous question regarding Bootstrap ScrollSpy and this is my final attempt at trying to get this to work.
What I am trying to achieve is to change t
You need to move the data-spy and data-target attributes from the body:
and move them to the div "spyOnThis":
Should be:
Per the documentation:
"To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component."
Based on your HTML you also need to fix a couple things:
Your list tags are not closed:
Should be:
Your divs not properly closed either:
Available on 9th Jan 2013
Available on 11th Jan 2013
Available on 18th Jan 2013
Available on 23rd Jan 2013
Available on 25th Jan 2013
Should be (just showing a couple of them):
Available on 23rd Jan 2013
Available on 25th Jan 2013
Also it seems that the 100% height causes it to only highlight the bottom-most entry in the navbar list.
- 热议问题