Scrollspy help?

Scrollspy help?
0

#1

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.


[Solved] Help with ScrollSpy
#2

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.


#3

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.


#4

Have you read these part of the scrollspy docs: [Requires relative positioning] (http://getbootstrap.com/javascript/#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:


#5

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:


#6

This info helped me figure it out:
http://www.w3schools.com/bootstrap/bootstrap_ref_js_scrollspy.asp


#7

thanks for the link.


#8

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