Hi there,
I believe I’ve been through every forum post on this subject, but I believe something must be wrong in my JS provided in a previous post. I am trying to utilize the toggle hash feature in a v2 Tabs element.
Each item I’m linking to works perfectly when simply entering the url into the browser. But it doesn’t auto-scroll to the tab when using on-page links.
Ex: https://2020template.wmcircleofexcellence.com/#tab6
Here is the JS code I currently have on the page (pulled from another thread):
jQuery (function($){
$(window).load ( function() {
if(window.location.hash) {
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
var header_height = 100 + $('#wpadminbar').height();
var yloc = $('[data-x-toggle-hash="' + hash + '"]').offset().top - header_height;
$('html, body').stop().animate({
scrollTop: yloc
}, 850);
}
} );
});
Can you help me determine what I’m doing wrong here?
Thank you!!