Reputation: 63
Hi im Using Bootstrap Scrollspy within the foundation framework.
So far I managed to get scrollspy to work but not like it should.
scrollspy changes the state of the navi correctly but not exactly on the specified div.
The first div container where scrollspy should change the navi works well but then the offset to the following containers increases and at the end scrollspy changes it's state in nomansland and not on top of the div.
When the site is loaded scrollspy displays the last nav entry and not the first??
I guess it is something with percentage based layout. What do you think?
You can find the dev page here:
http://dekonstruktiv.ch/static_sheggendorn/
Thanky for any help
Upvotes: 3
Views: 6586
Reputation: 4059
It looks like there are some elements being added to the page after scrollspy gets initialized. You will need to call refresh after everything is loaded.
$('[data-spy="scroll"]').each(function () {
var $spy = $(this).scrollspy('refresh')
});
Upvotes: 5