Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1206198
    Brian H
    Participant

    Ive seen several posts about linking to a specific tab, is there a definitive answer on this?
    I want to have a link on the same page that links to an open tab.

    #1206264
    Prasant Rai
    Moderator

    Hello Brian,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Thanks.

    #1209998
    Brian H
    Participant
    #1210231
    Rupok
    Member

    Hi there,

    Thanks for writing back. That’s the best solution for your case – https://community.theme.co/forums/topic/open-accordion-from-link/#post-65132

    Cheers!

    #1210393
    Brian H
    Participant

    Hey there I tried this solution but it didnt seem to work:

    https://vvoice.staging.wpengine.com/test-products/

    #1210876
    Rupok
    Member

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1211397
    Brian H
    Participant
    This reply has been marked as private.
    #1212380
    Lely
    Moderator

    Hi Brian,

    Thank you for the credentials. There’s an update in the structure of the tab that’s why the code is not working anymore. I update the code to this:

    /* Open Tab from Link */
    jQuery(function($){
      
      $(document).ready(function() {
        var tabnum = location.href.split("#").slice(-1)[0] ;
         x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]') );
      });
    
      $('.link_to_tab').click(function(e){
        e.preventDefault();
        x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]'));
      });
    
    });
    
    function x_scroll_to_tab($, tab_nav) {
                $(tab_nav).click();
    	            $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing');
    
    }

    It is working now. See this:http://screencast-o-matic.com/watch/cD6lVMj4gp

    Cheers!

    #1212405
    Brian H
    Participant

    The issue I’m having is that when you click on the learn more buttons it doesnt work, it works in the nav bar but I want the 4 learn more buttons to go to the open tabs.

    #1212754
    Lely
    Moderator

    Hi Brian,

    Thank you for the clarification. I update the code to this:

    
    jQuery(function($){
      
      $(document).ready(function() {
        var tabnum =  location.href.split("#").slice(-1)[0] ;
         x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]') );
      });
    
      $('.enable_jump_to').click(function(e){
        var tabnum = $(this).attr('href'); 
        e.preventDefault();
        x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]'));
      });
    
    });
    
    function x_scroll_to_tab($, tab_nav) {
                $(tab_nav).click();
    	            $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing');
    
    }

    See this:http://screencast-o-matic.com/watch/cD6l6Ej4sy
    Add the href value for the button under statevoice and localvoice button for it to work there.

    Hope this helps.

    #1212782
    Brian H
    Participant

    THANK YOU!! you guys are the best!!

    #1213208
    Joao
    Moderator

    Glad to hear we managed to help,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1206198 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>