Using hashtag in my nav menu messes up my site (sticky nav not showing – jquery error)

I am having trouble understanding this issue.

My site uses a 2nd (sticky) navigation when you scroll down on the page.

Read More

When I add custom links to the menu containing a hashtag (e.g. /subpage#heading5), so that you can visit an anchor directly via menu button, the sticky menu is not showing up any more.

When working properly, the sticky menu is shown when you scroll to a certain point using jquery.

I get an error only when I start to scroll on the page and the same error accumulates as I scroll more. Error:

“Uncaught Error: Syntax error, unrecognized expression:
/about-us#who-we-are”

For debugging reasons I am only using one hashtag in my navigation (nav button”About us -> Who we are”), using this custom link:

/about-us#who-we-are

Site: CLICK

Best regards!

EDIT: Omidam81 helped me to partialy resolve the problem.. The error is still present in console, so if anybody has an idea, im still on it. Thanks!

Related posts

1 comment

  1. I checked your code on your website, if you change the href of your menu from ‘/about-us#whoweare’ to ‘about-u#whoweare’ it work.

    if you ask why? i don’t know :).

Comments are closed.