I'm trying the ScrollSpy Bootstrap plugin, but it's not working properly. See the code below, it always highlight the last item.
http://jsfiddle.net/bRYMC/
<nav id="navbar">
<ul class="nav">
<li><a href="#page1">Page 1</a></li>
<li><a href="#page2">Page 2</a></li>
<li><a href="#page3">Page 3</a></li>
<li><a href="#page4">Page 4</a></li>
<li><a href="#page5">Page 5</a></li>
</ul>
</nav>
<div data-spy="scroll">
<section id="page1" class="page">
<h1>Page 1</h1>
</section>
<section id="page2" class="page">
<h1>Page 2</h1>
</section>
<section id="page3" class="page">
<h1>Page 3</h1>
</section>
<section id="page4" class="page">
<h1>Page 4</h1>
</section>
<section id="page5" class="page">
<h1>Page 5</h1>
</section>
</div>
Can you help me?
Set the data-spy="scroll"
on the body tag and it should work. Please check the updated jsFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With