Link to Tabs Broken

I was able to get Script from the forum that allowed me to create links to tabs…well it looks like that with Cornerstone 3.0 the way the tabs are coded has changed and broken the script. Could someone provide updated Script so I can make this work again?
Here is a link to our site: http://rossdd.org/early-intervention/#tab-1

Any help would be appreciated.

Thank you

Hi there,

Could you please try following this post and see if that helps (https://theme.co/apex/forum/t/need-js-code-snippet-for-navigating-to-specific-tab/26952/6?u=mldarshana).

Thanks!

There does not seem to be a solution for us on this thread. I’ve tried the updates but I believe they are for older versions of Cornerstone.

Hi there,

Would you please kindly add the Javascript code below to X > Theme Options > JS:

jQuery( function($){ 
    $( document ).ready( function(){
        scroll_to_tab ( location.href.split("#").slice(-1)[0] );
    });

    $('a.link_to_tab, .link_to_tab a').on( 'click', function( e ){
        var window_base = location.href.split("#").slice(0)[0];
        var url_base = $( this ).attr('href').split("#").slice(0)[0];    
        if ( window_base == url_base ) {
            scroll_to_tab ( $( this ).attr('href').split("#").slice(-1)[0] );
            e.preventDefault();
        }

    });

    function scroll_to_tab ( tab_id ) {
        var tab_nav = $('.x-nav-tabs .x-nav-tabs-item a#x-legacy-' + tab_id);
        if(tab_nav.length >=1) {
            $( tab_nav ).trigger('click');
            $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 ) },700 ,'swing');}
        }
    });

If it is not working kindly get back to us with the result of the steps above and URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case.

Thank you.

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