Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #801425

    Hello, I am using the new tab Section which is a great feature!
    My Tabs contain long text content. Therefore i would like to add Links with #anchors on top to jump in the open tab to the linked passage. I can add div with ID as a codeblock, but there is no way to get the link jump to the anchor. Works fine outside the Tab Section but within I cannot jump to my #anchors.

    Let me know if you have a solution for this.

    • This topic was modified 7 years, 5 months ago by royaltask.
    #801485

    Hey royaltask,

    Can we have a link to the page in question so we can take a look?

    Best regards,
    Sarah

    #801489

    Sie is offline and using LAMP.

    Maybe this helps: Anchors in the Tab Section (new Element Kriesi added last Update) are not working.
    Is this correct?

    #802617

    Hi royaltask,

    Depends on the setup. It’s really hard to propose a solution for you without any context. And yes, there is an issue with anchors, but more like tab titles.
    So we could have a look when you have your website on some test or staging server.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #802627

    Thank you. I use “Demo Enfold 2017” without any changes. I added more content to the new tab Section. One Tab has a long Text inside with Sections. In this text I added some Link to jump in this Tab to my defined section #mysection

    Is the usage of anchors in a tab impossible?

    • This reply was modified 7 years, 5 months ago by royaltask.
    #804113

    Hi,

    You are right.
    You can not trigger a tab with an anchor URL.

    Here is a code that can be used, to direct a link to urls tab from URL, for WooCommerce.
    You can adapt it

    function wc_direct_link_to_product_tabs() {
    	if( is_product() ) {
    	?>
    	<script type="text/javascript">
    		jQuery(document).ready(function($) {
    	
    		    if( window.location.hash ) {
    			    
    			    // Vars
    			    var tab 		= window.location.hash.replace('#', '');
    			    var tab_content = 'tab-' + tab;
    	
    		    	// Tabs
    		    	$( 'li.description_tab' ).removeClass( 'active' );
    				$( 'li.' + tab + '_tab' ).addClass( 'active' );
    				
    				// Tabs content
    				$( '#tab-description' ).hide();
    				$( '#' + tab_content ).show();
    			}
    		
    		    // when the tab is selected update the url with the hash
    			$(".tabs a").click( function() { 
    				window.location.hash = $(this).parent('li').attr("class").replace(' active', '').replace('_tab', '');
    			});
    	
    		});
    		</script>
    	<?php
    	}
    }
    add_action( 'wp_footer', 'wc_direct_link_to_product_tabs', 30 );

    Best regards,
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.