Scrollspy Bootstrap v3.3 not working

后端 未结 2 1235
被撕碎了的回忆
被撕碎了的回忆 2021-01-26 10:59

Using Bootstrap v3.3 w/ affix on navigation bar. Affix is working fine, but I cannot get the scrollspy to work at all. I created a fiddle here (removed affix from fiddle) to att

2条回答
  •  無奈伤痛
    2021-01-26 11:29

    @vanburenx - your post was correct, however, the only thing I needed was to add the class, .nav, to the corresponding ul element.

    Per the boostrap 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.

    
    

提交回复
热议问题