Bootstrap Scrollspy Error in Firefox

I am putting some documentation together using Bootstrap and am facing a problem with the Scrollspy plugin in Firefox. In fact, the “active” class joins the last element of the list in my sidebar navigator and will not change even when scrolling the page.

I have compared my example with the version of Bootstrap and cannot determine the differences between them. The script works in all other browsers, including IE8 +.

I found my working example here, so that someone can look if you have time (the source of the page is very simple, so it may just be easier to look at it here in Firefox than at jsFiddle or something): http: / /dev.themusicake.com/

Scrollspy documentation can be found here: http://twitter.github.com/bootstrap/javascript.html#scrollspy

I use data attributes in the <body> element as suggested:

 <body data-spy="scroll" data-target=".nav-affix-container"> 

There are no errors in the console, adding issues related to troubleshooting. If anyone has had any problems with this particular problem in the past, any help would be greatly appreciated!

Please let me know if you need anything else!

+4
source share
2 answers

Remove height: 100% from body .

+8
source

For me, the problem was that I used float: left the contents of the div, which leads to a height = 0 in the content itself. Therefore scrollspy will not be able to determine the height (I think?)

I just used clear and below div content to fix the problem.

  <br style="clear: both"/> 
0
source

Source: https://habr.com/ru/post/1440838/


All Articles