Anchor broken since update?

Hi there,

since a short time my anchors on the page do not work anymore. Didn´t change anything.

https://r6-tegernsee.de/eg-wohnung-1

The 4 banners have links to IDs from sections.

Example:
first image has the URL to: #einrichtung1
The second section has the ID: einrichtung1.

Worked fine before. Now it doesn´t. Any suggestions?

Greetings,
Lars

Hi Lars,

Do you have a cache plugin installed? If so, kindly try to full clear the cache of your site and kindly clear your browser cache as well.

Hope this helps.

HI there,

yes I have WP-Super Cache installed. Cleared it, as well as the browser. Problem remains.

LG
Lars

Hi There,

Thanks for writing in!
I can see there is some javascript error on the page, which causes the issue.

This may due to several reasons, Firs please disable all third-party plugins one by one to narrow down the cause of an issue.
You can also remove all custom CSS and JS if you have added to the site.

Let us know the result. If that doesn’t help Please send us your login details to check. Please send is a secure note

thanks.

Hmm thanks for your reply basanta,

tried it but it doesn´t solve the problem.

I give you my login data, hope you can find a quick solution.
Thanks a lot!

The issue is because of your custom code in that page. Here’s the code I removed from your Content JS and now your links work.

jQuery(function($){
  $('a[href*="#"]:not(.x-btn-navbar)').off('touchend click');
  $('a[href*="#"]:not(.x-btn-navbar)').on('touchend click', function(e) { 
    e.preventDefault();
    var id = $(this).attr('href').split("#").slice(-1)[0];;   
    var theid = $("#" + id);
    console.log(theid);
    if (theid.length === 0) {
        return;
    }
    
    var pos = theid.offset().top + 1;
    $('body, html').animate({scrollTop: pos}, 1000, 'easeInOutQuart');
    return false;
  });
});

Thanks.

Thanks @christian_y !

I removed all the code and the links work now.

But in the past I added this code, so that the anchor scrolling leaves out the Top-nav-bar, so that the Section ist centered in the screen under the top nav bar. Hope I could explain it understandable…
I got the code from @Lely reffering to this topic:

Is there an solution now for my scrolling issue? Because now without the code it leaves this gap on the top. (See attached image)

Greetings
Lars

Hi there,

Change your code to this and it will work,

jQuery(function($){
  $('a[href*="#"]:not(.x-btn-navbar)').off('touchend click');
  $('a[href*="#"]:not(.x-btn-navbar)').on('touchend click', function(e) { 
    e.preventDefault();
    var id = $(this).attr('href').split("#").slice(-1)[0];;   
    var theid = $("#" + id);
    console.log(theid);
    if (theid.length === 0) {
        return;
    }
    
    var pos = theid.offset().top + 1;
    $('body, html').animate({scrollTop: pos}, 1000 );
    return false;
  });
});

The problem is with 'easeInOutQuart', that easing doesn’t exist anymore. Which could be due to other plugins, or you deactivated a feature that extends jQuery easing.

Thanks!

1 Like

Hi, i have the same issue.
I created a test page with minimal element : https://www.3is.fr/bordeaux/test-ancre/

Can you help me?
thanks

Hello @cpennetier,

Thanks for asking. :slight_smile:

I request you to please create a separate ticket and share the problem you are facing and someone from support team will assist you further. Actually posting in a different thread create lot of confusion and slows the response time.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.