Button Link to tab

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

Hello @simonwr1976,

Thanks for writing to us.

It would require custom development. I would suggest you contact a developer who can assist you with your concern or you can avail our service called One, where the customization questions are answered.

Please note that the code provided in the other thread serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Thanks for understanding

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