Problems with ScrollSpy (Bootstrap 4)

Problems with ScrollSpy (Bootstrap 4)
0

#1

Hello!

So, last week I started FreeCodeCamp, and this weekend I made my first project (the portfolio one).
It was going very well actually, and then I wanted to set up the navbar with the ScrollSpy.

I am able to click on the menu and go to where it’s supposed to go on the page (a little bit too far; I’m also not able to correct it), but the button on the menu doesn’t change it’s “active” class, no matter where I am on the page it keeps active only on the first link…

I tried everything! I’ve added things, I’ve removed things, and now it’s just getting too confuse, I can’t solve this problem…
Can anyone offer me some enlightenment please?

Here is the Pen: https://codepen.io/shivayl/pen/oGYjyG

I am sorry if I had bad English (it’s not my primary language, and I’ve been coding for a lot of hours now), and thank you in advance.


#2

you need to call scrollspy via js
scrollspy docs


#4

I was trying to do the Scrollspy using only the classes.
I found the problem/bug.
I forgot to add a “nav-link” class to the other links in the navbar, there was only one for the first lol…
Finally did it!

Thank you anyway!