Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap scrollspy flicking between sections

I have implemented a subnav style Bootstrap scrollspy on my page but odd things seem to be happening. I have four sections, each in a div with I have given an id to. However, when either clicking on the link or scrolling, it is jumping to odd places.

It can be viewed here. http://www.writeupp.com/faq.aspx

Any ideas?

like image 444
natlines Avatar asked Dec 29 '25 21:12

natlines


1 Answers

I was having a similar issue that you speak of. Where the top nav flickers when I scrolled. I realized that it was because I had tabbable content on the page. My fix to this was to add data-target=".navbar" to my body element in addition to the data-spy="scroll" so that scrollspy knows which navigation bar to alter. I hope this helps.

<body data-spy="scroll" data-target=".navbar">
like image 138
Trav McKinney Avatar answered Dec 31 '25 18:12

Trav McKinney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!