twitter/bootstrap — Issue #2210: Scrollspy flickers between 2 nav elements when their order in navbar doesn't match order on the page
Author: mpobrien
Created: 2012-02-23 17:49:14+00:00
State: open

For example, in lines 83 - 88 of less.html in the docs:

Built with Less

Variables

Mixins

Compiling Bootstrap

If we change the order of these nav elements like this, so they don't match the order of the scrollpositions of the corresponding sections on the page, the active links will "flickr":

Built with Less

Compiling Bootstrap

Variables

Mixins

I have a proposed fix: simply sort the calculated offsets when the scrollspy is first created.