Navbar links not scrolling to section of page


my navbar links(work and contact links) are not scrolling to section of page i want it to, here is my github link to my portfolio code. I am using href and id properly, maybe anyone else can see the prob:

mraees93/portfolio (

The “work” and “contact” links seem to be working properly for me. I think you might have the “about” link pointing to the wrong id though?

The “work” and “contact” links work properly when scrolling down with sidebar yes but when i click on them it supposed to scroll down to “work” and “contact” page sections

I might not understand the problem you are trying to describe? When I click on the Work link at the top, the page scrolls to the work section (My Projects). When I click on the Contact link at the top, the page scrolls to the Contact section. The About link is scrolling all the way to the top of the page instead of to the “About Me” section, which I’m assuming is an error, but this is an easy fix, you just have the About link pointing to the wrong id.

If I’m missing something here please be very detailed in describing your issue.

the top and bottom arrow links work perfect with the id when clicking it but the prob i have is when i click on the “work” and “contact” links in the navbar . When i click on “work” and “contact” links the page should also scroll to the work and contact sections of the page, the right id and href are in my code

All I can say is that they are scrolling for me.

I noticed you are using jQuery to do the animated scrolling. Perhaps check the JS console to see if you are getting errors?

It works in Firefox but not in Chrome.

It is related to your scroll script code. Some of the lib code is also super old, like 8 years old (onePageNav). I would suggest dropping the JS scroll stuff and just use scroll-behavior: smooth on the html element. If you do want JS scroll code I would look for some updated and maintained lib instead.

That will teach me for using FF :slight_smile:

Sorry @mraees93, I didn’t think to check with Chrome. Could have saved us a lot of back and forth. And I completely agree with @lasjorg, switch to CSS for the smooth scrolling behavior.

1 Like

haha thanks im using edge and my reviewer is using chrome, i will try to fix it then get back to you if i have any probs