Scrollspy Help!

Scrollspy Help!
0.0 0

#1

Hi I was trying to get scrollspy to work and I’ve followed all of the reference material but haven’t found anything that would explain why mine isn’t working. Thanks in advance!


#2

Check your settings. You have way too many includes (bootstraps 3 and 4 BOTH).

For BS3:
CSS - Bootstrap.css
JS - (in order):
jQuery
BS3.js

For BS4:
CSS- Boostrap.css
JS - (in order)
Jquery
Popper.js
BS4.js


#3

It’s strange, when I take off one of the bootstraps, my navbar becomes nonexistent.


#4

It also seems that I need Jquery UI for it to work as well.


#5

Well, you have got to decide which bootstrap you want to use, version 3 or 4. Bootstrap is a combination of style sheets and Javascript. The bootstrap .js file depends on jQuery in both cases. In the case of Bootstrap 4, it also depends on Popper.js, which in turn depends on jQuery. In CodePen, JS files must come after the one on which they depend. Pick one “stack of technology” and make sure the javascript files come in the correct order. There are “hamburger menu”-looking drag handles to the left of the filename. If you insist on using Bootstrap at such an early stage, it will seemingly make things that are complicated easier, but it comes at a pedagogical cost. You will learn more if you do the project in raw CSS and HTML. I personally did it twice - the first time using Bootstrap, until I went to a local meetup and discovered the Beta. I started the whole thing over again, and learned so much in the process. Bootstrap comes later in the curriculum, and the upcoming revised order to the curriculum does things right.