Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1326861
    malasretail
    Participant

    Hi Support
    On my home page I have 4 links to a product page which has 4 tabs on the page.
    When I click on any of the 4 links on the home page I would like for it to open the Products page and make the specified tab active.

    Is this possible?

    #1326864
    Friech
    Moderator

    Hi There,

    Thanks for writing in! It could be possible with custom development, but regretfully this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.

    Thanks for understanding.

    #1342656
    malasretail
    Participant
    #1342788
    Paul R
    Moderator

    Hi,

    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.

    #1342974
    malasretail
    Participant
    This reply has been marked as private.
    #1343513
    Nabeel A
    Moderator

    Hi again,

    Thank you for providing the URL. Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery( function( $ ) {
    	$( document ).ready ( function() {
    		var target_tab = window.location.search.split('=')[1];
    		var tab_index = 1;
    		switch ( target_tab ) {
    			case 'tyres': 
    			tab_index = 1; 
    			$( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).click();
    			$('html, body').stop().animate( { scrollTop : $( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).offset().top - 80 } );
    			break;
    			
    			case 'truck': 
    			tab_index = 2; 
    			$( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).click();
    			$('html, body').stop().animate( { scrollTop : $( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).offset().top - 80 } );
    			break;
    			
    			
    			case 'wheels': 
    			tab_index = 3; 
    			$( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).click();
    			$('html, body').stop().animate( { scrollTop : $( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).offset().top - 80 } );
    			break;
    			
    			
    			case 'components': 
    			tab_index = 4; 
    			$( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).click();
    			$('html, body').stop().animate( { scrollTop : $( 'a[data-cs-tab-toggle="' + tab_index + '"]' ).offset().top - 80 } );
    			break;
    			
    			default: tab_index = 1; break;
    		}
    
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

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