I have tabs on the page https://cineon.training/mri-patient-scanning-experience and on the first page are two buttons, on the first button I’ve added the link https://cineon.training/mri-patient-scanning-experience/#tab-1499-14. I also added the following javascript which I copied from a similar thread;
jQuery( function($){
$( window ).on('load resize', function(){
scroll_to_tab ( location.href.split("#tab-").slice(-1)[0] );
});
$( '.link_to_tab' ).on('click touchstart', function(){
var mylink = $(this).attr("href");
scroll_to_tab ( mylink.split("#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-cs-tab-toggle="' + 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');
}
}
});
but it’s not working