Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript smooth anchor link scroll, anchor point sticky header compensation, etc. Reply To: smooth anchor link scroll, anchor point sticky header compensation, etc.

#195511
Shikkediel
Participant

The issue is only in this line :

if (location.pathname.replace(/^\//,”) == this.pathname.replace(/^\//,”) && location.hostname == this.hostname) {

Unfortunately there’s now way to show the difference here because of similar parsing properties. But you can look at the page source – two backslashes are missing and the ampersands are altered. My idea would be to use ftp and circumvent the WordPress parser on your site. Or at least figure out how to get the script in the head segment correctly otherwise.
I am not familiar with WordPress so I can’t assist in any way there.

If you describe what hightlighting would be required, I’m quite sure it would only need a few extra lines to the current script instead of a plugin.

Link to the script

Whole lotta code…