Bootstrap scrollspy not working

This is what I came across.

http://bittu.github.com/folderGrid/

First, the last tab is highlighted, and when scrolling, it switches between two tags at each step of scrolling.

Here is a small piece of code that I used.

<body data-spy="scroll" data-target=".subnav" data-offset="50">

<div class="subnav">
    <ul class="nav nav-pills">
        <li><a href="#contents">Contents</a></li>
        <li><a href="#config">Config Options</a></li>
        <li><a href="#usage">Usage</a></li>
        <li><a href="#examples">Examples</a></li>
    </ul>
</div>

<div class="row">
    <div class="span12">
        <section id="contents">
            ....
        </section>
        <section id="config">
            ....
        </section>
        <section id="usage">
            ....
        </section>
        <section id="examples">
            ....
       </section>
    </div>
</div>

All necessary files are included. and tried all the numbers fordata-offset

+5
source share
2 answers

Twitter bootstrap does not define a class subnav. It is provided on the Twitter page for Bootstrap, but to reuse it you need to add some code from CSS . It is intended solely for this page. Subnav locks the position when scrolling, to see how it works, take a look at CSS and JS .

0

. , ( body section ). , , <!DOCTYPE html> , html5.

, bootstrap v2.1

0

All Articles