Hello,
There’s another script in your theme that handles page scrolling and actively preventing “Page scroll to id” from doing its thing. The script is this one:
...themes/globallogistics/fw/js/core.init.js
The culprit function is in line 185 under comment “One page mode for menu links (scroll to anchor)”.
My guess is that the theme was updated and this functionality was added. I’m not sure if this theme scroll to anchor feature is working correctly, as it fails to scroll to the target when tested.
You first need to check if there’s an option or setting in your theme to disable this functionality (probably titled “One page mode for menu links” or “Scroll to anchor”).
If such option does not exist, the only way to disable this is to manually edit the core.init.js file. If you can do this, just comment the code from line 185 to 204 (i.e. wrap the code in /*
and */
):
/* jQuery('#toc, .menu_main_wrap ul li, .menu_user_wrap ul#menu_user li').on('click', 'a', function(e) {
"use strict";
var href = jQuery(this).attr('href');
if (href===undefined) return;
var pos = href.indexOf('#');
if (pos < 0 || href.length == 1) return;
if (jQuery(href.substr(pos)).length > 0) {
var loc = window.location.href;
var pos2 = loc.indexOf('#');
if (pos2 > 0) loc = loc.substring(0, pos2);
var now = pos==0;
if (!now) now = loc == href.substring(0, pos);
if (now) {
themerex_document_animate_to(href.substr(pos));
themerex_document_set_location(pos==0 ? loc + href : href);
e.preventDefault();
return false;
}
}
}); */
Let me know ??