Twitter Bootstrap scrollspy always selecting last element

后端 未结 13 1638
旧巷少年郎
旧巷少年郎 2020-12-08 04:22

I have an issue with scrollspy, recreated in this fiddle: http://jsfiddle.net/jNXvG/3/

As seen in the demo, the ScrollSpy plugin always keeps the last menu item sele

13条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 05:12

    FYI: To get my desired effect (same one as on the Twitter Bootstrap docs page) I needed to set 'body' as my target element...I could not get scrollspy'ing to work by using the immediate parent of the elements I wanted to spy as the target.

    (It just auto-selected the my last element always)

提交回复
热议问题