Hi @walton,
Please try this and let me know if it works for you:
const tabOpener = function(tab) {
// Simulate a click on that tab.
if (typeof tab === 'string') {
const currentTab = jQuery('.' + tab + '_tab');
currentTab.children('a').click();
}
// Scroll to that tab.
jQuery('html, body').animate({
scrollTop: jQuery('#tab-' + tab).parent().offset().top,
}, 300);
};
jQuery(document).ready(function($) {
const {hash} = window.location;
let tab;
// If a # exists in the url lets see if its a tab.
if (hash && hash.includes('#tab-')) {
tab = hash.replace('#tab-', '');
return tabOpener(tab);
}
// On click we'll check to see if the event target has a tab hash.
$('body').on('click', function(e) {
if (e.target.hash && !e.target.hash.includes('#tab-')) {
tab = e.target.hash.replace('#tab-', '');
return tabOpener(tab);
}
});
});
Jon
Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hello @walton,
Just checking in.
Please let us know if you still need help with this issue.
Thank you!
-Tracy
Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hello @walton,
We haven’t heard back from you in a while so I am going to close out this ticket.
If you need more help, please reopen it and we will be happy to help you.
Thank you!
-Tracy