Scrollspy help?

I tried adding scrollspy to my homepage, but I haven’t been able to get it working properly yet.

To troubleshoot the issue, I created a separate branch, but I haven’t found all of my mistakes yet. If someone could point out what I’m overlooking I would greatly appreciate it.

Your first problem (maybe only problem - I haven’t looked to closely yet) is in your error console for the homepage. You can open the error console using Chrome developer tools (ctrl + shift + I) and selecting the Console tab. Your page is reporting bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery.

So make sure you load jQuery before Bootstrap.js.

If you just want your page to scroll when you click on the nav links, you might find this code snippet easier to implement? YMMV.

Thanks for the quick reply. I added jquery while testing it on my desktop and forgot to push the commit.

Unfortunately, it didn’t resolve toe scrollspy issue.

Have you read these part of the scrollspy docs: [Requires relative positioning] ( and Via Data Attributes?

I can’t tinker with your code without cloning your repo, but viewing the source suggests to me that they might be avenues worth looking into. Beyond that, I haven’t used scrollspy, so I can’t really offer more help :slight_smile:

Thanks, my original post was missing the “relative positioning”, but I have added it to the navbar-active branch. It didn’t resolve the issue. :cry:

This info helped me figure it out:

thanks for the link.

So that’s how you do it - i’ve never really heard of scroll spy until today - YAY