Dear all,
I am trying to add scrollspy to my portfolioMyPortfolio. Following the guide of Bootstrap-Javascript Javascript-Bootstrap I tried two ways:
- data-target="#topbar"
- data-target=".navbar"
But both don’t work.
I am really confused. Did I use something wrong?
P.S libiaries are included, body css is configured.
Thanks for answering!
Are you using CodePen? Is there a way you could post your code?
Yes, I am using Codepen. The link is here Portfolio.
What interesting is that, when I create a new Pen and paste the code into it, the scrollspy works.
This is the new Pen having the same code there. New Pen
bnoden
4
In the working version, you loaded jQuery before bootstrap, and vice versa for the non-working version.
2 Likes
Thank you very much! Now I see that jQuery should be loaded before bootstrap so that it works!