A recent version of Google Chrome update (61.0.3163.100 to be specific) has affected in-page anchor links on certain sites. Clicking on a hash link will not do anything when the expected behaviour is to take the user to the linked section with smooth scrolling.
These are sites that rely on older versions of jquery.localScroll and jquery.scrollTo for smooth scrolling after clicking on hash links.
The fix is to replace both those files with their latest versions.
At the time of writing this, the problem is present in the current latest version 3.1.4 of Agency Pro, a Genesis child theme.
Follow these steps:
Step 1
Connect to your site’s server via FTP and navigate to theme’s js
directory inside the child theme.
Step 2
Delete jquery.localScroll.min.js and jquery.scrollTo.min.js.
Step 3
Download jquery.localScroll.min.js and jquery.scrollTo.min.js.
Upload both the files to js directory.
via Nick Cernis.
I have the same problem with Digital Pro, but the above solution doesn’t fix it.
Can you provide the URL of your site?
Sridhar, thank you for this! It worked beautifully with Agency Pro. 🙂
Awesome, thank you!
Did not work for me in Agency Pro
Big thank you
for my client’s old wordpress theme I only had to replace jquery.scrollTo.min.js.
Actually I renamed it to jquery.scrollTo.js match the file in the js folder
Thank you Sridhar,
It works on two sites with Altitude Pro as basis theme.
Nice you share this fix, saved me a lot of time 🙂
I have the same problem with Altitude Pro. For some reason, this did not fix it.
Here is the URL http://orthodonticdetails.com/
Will you please look at this?
Hi Sridhar, I noticed ‘1.2.8b’, true and ‘1.4.5-beta’, true in my functions file and wondered if this should be changed since we updated the js to a new version:
//* Enqueue scripts
add_action( ‘wp_enqueue_scripts’, ‘altitude_enqueue_altitude_script’ );
function altitude_enqueue_altitude_script() {
wp_enqueue_script( 'altitude-script', get_bloginfo( 'stylesheet_directory' ) . '/js/home.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'localScroll', get_stylesheet_directory_uri() . '/js/jquery.localScroll.min.js', array( 'scrollTo' ), '1.2.8b', true );
wp_enqueue_script( 'scrollTo', get_stylesheet_directory_uri() . '/js/jquery.scrollTo.min.js', array( 'jquery' ), '1.4.5-beta', true );
}
Yes.
You also need to change the version numbers in the wp_enqueue_script() function calls because if otherwise, browser will be using the old/cached versions of the scripts and not the latest ones.
OMG, I was freaking out not being able to figure out what was going on with this. Thanks for the fix!
Thank you very much – wasted way too much time to check for faults in one of my website’s code .
Hello — Do you know if this is a similar problem on some mobile browsers? I’m using Magazine Pro and all jump (anchor) links work fine in desktop browsers (IE, Chrome, Firefox) — but on mobile they only work in Firefox (they are misaligned greatly in mobile version of Chrome and MS Edge). I have checked all plugins I have that could have “offset” settings, etc… and nothing seems to conflict. I am not technical, but I have been scratching my head of why this doesn’t work on some mobile browsers, and your post here makes me wonder if I do need to upgrade those mentioned jquery items above. I am using the latest Magazine Pro v. 3.2.4.
Can you provide the URL of your site?
This is a staging site. This link goes to a page that has several anchor links (from a table of contents and a “scroll to top” icon on the lower left.) While the problem isn’t exclusive to this page (or the plugins used for this) that I can tell — as mentioned previous, the scrolling works fine on all desktop browsers I’ve tested, but not on all mobile browsers.
Particularly, on mobile Chrome and IE, the anchors are offsetting well below where they should be (not sure how to measure it, but several lines of content — maybe 50-100 lines — offset below).
Here is the link: https://www.myfederalretirement.com/scroll
Thanks for taking a look and any direction you might be able to point me to would be appreciated.
I tested the in-page anchor links on that page in Safari and Chrome on my iPhone and they are working fine.
Are you using an Andorid?
Thanks for checking. Yes, I’m using Android and forgot to mention that.
Thanks for checking. Yes, I’m using Android and forgot to mention that.
Hi,
I am having this problem with Café Pro – and I tried the fix, no luck. Any thoughts?
My page is here: http://www.mastevensinc.com/
Thanks,
-Kent
Hi Kent,
Just checked your site and the anchor links are working fine in Chrome for me.
Sridhar,
Weird. Ok. I will check everything again, must be a cache thing for me. Thanks for checking.
Hello i have the same problem with my theme “Digital-Pro”, i tried replaceing the js files but still didnt work, what else do i have to do.
i replaced both files in my js folder but still get the same problem
http://rubenhernandez.mx/wp-content/themes/digital-pro/js/jquery.localScroll.min.js shows the content of jquery.scrollTo.min.js file.
Thanks for this post, worked with Altitude Pro perfectly. 🙂
Worked as usual with your tutorials! Thank you Sridhar!!