Url to open a tab

Hello

I have been using urls in my menu to open up specific tabs in pages.

Last year i had to change urls to this format : /#x-legacy-tab-2

And use this js code:

jQuery( function($){
$( window ).on(‘load resize’, function(){
scroll_to_tab ( location.href.split("#x-legacy-tab-").slice(-1)[0] );
});

function scroll_to_tab ( tab_id ) {
console.log(tab_id);
var tab_nav = $(’.x-nav-tabs .x-nav-tabs-item a[data-x-toggleable="’ + tab_id + ‘"]’);
if(tab_nav.length >=1) {
$( tab_nav ).trigger(‘click’);
$(‘html,body’).stop().animate({scrollTop: $(tab_nav).offset().top - ( $(’.x-navbar’).height() + 50 ) },700 ,‘swing’);
}
}
});

jQuery(".x-accordion-toggle").click(function(){
if(jQuery(this).hasClass(‘collapsed’)){
jQuery(this).text(‘Read Less’);
} else{
jQuery(this).text(‘Read More’);
}
});

Now this has stopped working for me and the urls only open the page (don’t open the right tab)

Is there a new way to accomplish this?
Thanks

Hey @steini,

Regretfully, this is not a feature offered in X and we could not continue on fixing issues that arise from the use of custom code even if we have given it here in the support forum. Custom codes were meant to be a guide or a starting point. We could not maintain them as they are not official parts of the theme.

You will need to consult with a third party web developer to continue with the custom development.

Thank you for understanding.

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