Links to anchors don't work when clicked, but only when entered manually

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
przemhb
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Sep 05, 2021 7:43 pm

Links to anchors don't work when clicked, but only when entered manually

Post by przemhb » Mon Sep 20, 2021 8:08 pm

For several years website I maintain worked fine - links to anchored part of the website in a top menu worked. Just recently I have noticed, that after some of updates (currently 3.10.2) when I click a link to an anchored part of the website it doesn't work. Oddly when I right-click and copy URL and then paste it a browser and go it works just fine.
Just try it by yourself https://ensolver.com/en/. For example click "Portfolio" in the top menu.
It links to https://ensolver.com/en/#section4 and the links works as long as it is entered manually and not clicked.

What causes the issue and how to fix it?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13715
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Links to anchors don't work when clicked, but only when entered manually

Post by toivo » Mon Sep 20, 2021 8:57 pm

Welcome to the Joomla forum!

The anchor works all right in Firefox 92.0 but fails in Chrome 93.0.

The DevTools (F12) Console reports the following error. Fix it and check if that helps:
Mixed Content: The page at 'https://ensolver.com/en/#section4' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family= ... ,latin-ext'. This request has been blocked; the content must be served over HTTPS.
Toivo Talikka, Global Moderator

przemhb
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Sep 05, 2021 7:43 pm

Re: Links to anchors don't work when clicked, but only when entered manually

Post by przemhb » Mon Sep 20, 2021 9:48 pm

Thank you for your prompt reply.

I've fixed the "mixed content" issue, but it didn't help. Apparently there's something more to the anchors' issue.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 28197
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Links to anchors don't work when clicked, but only when entered manually

Post by Per Yngve Berg » Tue Sep 21, 2021 8:14 am

The Menu Item worked when opened in a new Window.

Maybe it have to do with that the link containing full url instead of only the anchorpoint.

User avatar
Pavel-ww
Joomla! Explorer
Joomla! Explorer
Posts: 454
Joined: Tue Jun 30, 2020 12:17 pm

Re: Links to anchors don't work when clicked, but only when entered manually

Post by Pavel-ww » Tue Sep 21, 2021 8:57 am

Hi. I assume that the reason is this javascript
/templates/neue/javascript/jquery.localscroll.min.js

Rename the file and check. If the links will work, contact the template developer for fix or use a different smooth scroll javascript, or use css "scroll-behavior" (even without JS)

przemhb
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Sep 05, 2021 7:43 pm

Re: Links to anchors don't work when clicked, but only when entered manually

Post by przemhb » Tue Sep 21, 2021 7:11 pm

Pavel-ww wrote:
Tue Sep 21, 2021 8:57 am
Hi. I assume that the reason is this javascript
/templates/neue/javascript/jquery.localscroll.min.js
Indeed! Thank you. As you advised I've added scroll-behavior: smooth to the CSS as the developer of the template didn't reply for a week.

EDIT:
Unfortunately removing the jquery.localscroll.min.js introduced another issue - toggling parts of the text ceased to function. Luckily it was 3rd party javascript with a link to GitHub, so I've just downloaded the most recent version and overwritten the old and buggy one.


Post Reply

Return to “General Questions/New to Joomla! 3.x”