Why isn't Bootstrap's scrollspy working?
javascript, twitter-bootstrap
Solution
Hey I think there are two issues here:
(1) putting scrollspy on something other than the body causes problem. Check out this:
In Twitter Bootstrap's ScrollSpy, where exactly can I put data-spy="scroll"?
basically if you add:
#area-to-watch {
height: 200px;
overflow: auto;
}
it will you allow you to scrollspy to "spy" on something other than the body. http://jsfiddle.net/hajpoj/SZYKM/ This a modified version of your jsfiddle
(2) Putting scrollspy into a model causes more problems. If you put the above into a model, it kind of freaks out. I'm not positive but I think you need to do something like
.scrollspy('refresh')
stated in the docs http://twitter.github.com/bootstrap/javascript.html#scrollspy
Problem
I have a simple Bootstrap modal setup, and in the modal I have content with a `nav` and scrollspy set up. However, it isn't working. I see it gets activated, but the nav is never updated. The full source is too long for here and you wouldn't be able to see the effect I am getting, so I have set up a jsfiddle I am using the `data-spy="scroll"` method to enable it. What have I done wrong? Why isn't the nav being update with your position?