Anchor Links Not Working In Header Menu Item

zanders
Member

When I inspect the URL it is correct, but the link is not clickable on web or mobile. Visit skilltype.com and hover over the How It Works menu items to see what i'm referring to.Screen Shot 2021-09-22 at 11.36.31 AM.png

0 Upvotes
1 Reply 1
Teun
Guide | Diamond Partner

Hi @zanders ,

 

It seems that your main.js script is causing an issue. I get the following error in the console when I click on a link:


main.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'top')
at HTMLAnchorElement.<anonymous> (main.js:1)
at HTMLAnchorElement.dispatch (jquery-1.12.4.min.js:3)
at HTMLAnchorElement.r.handle (jquery-1.12.4.min.js:3)

 

Do you have experience in coding? You should remove the faulty function or replace it. `window.scrollTo` could be used instead, you can set the 'behaviour' param to 'smooth' to animate the scrolling.
You could also add smooth-scroll with the following script tag:

<script src="https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll@15/dist/smooth-scroll.polyfills.min.js"></script>

 

Did my answer solve your issue? Help the community by marking it as the solution.
0 Upvotes