Leesper's Portfolio

Hi everyone, I just finished my first portfolio project at Leesper’s Portfolio, just a basic version not adding back-ground pic yet, but I have accomplished all user stories, leave me some time to make it more beautiful, would you please have some advice for me? I really appreciate it! :wink:

I would add ScrollSpy so your navigation links update as you scroll down the page. Nice job, though! Looks great!

Hi, I just added the ScrollSpy, but it took me the whole day I still can’t find a way to turn it out, it seems that sth is wrong with my code, could you help me out? :joy:

Sure, it’s really simple. You followed the documentation very well, but unfortunately there’s a problem specific to CodePen that Bootstrap can’t tell you about. We’ll get around that, no problem. First, delete the data attributes you added to your HTML (we’ll do this through JavaScript). Next, add the jQuery and Bootstrap JavaScript libraries in CodePen, much the same way you added the stylesheets for CSS.

jQuery must come first.

Then, make sure that your about link points to the about section, and not just to the top of the page

<li class="active"><a href="#about">ABOUT</a></li> <!-- href="#" -> href="#about -->

Now this part I’m going to ask you to think about. See if you can fill in the blanks and then place this line in the JavaScript section.

$('____').scrollspy({ target: '______'})

well, your help is really amazing!,first I tried “$(‘main’).scrollspy({ target: ‘#my-navbar’})”, that doesn’t work, then I tried “$(‘body’).scrollspy({ target: ‘#my-navbar’})”, and that’s correct, I really appreciate your help

1 Like