-
AuthorPosts
-
May 30, 2017 at 10:29 am #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, 6 months ago by royaltask.
May 30, 2017 at 1:17 pm #801485Hey royaltask,
Can we have a link to the page in question so we can take a look?
Best regards,
SarahMay 30, 2017 at 1:20 pm #801489Sie 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?June 1, 2017 at 3:55 pm #802617Hi 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,
VictoriaJune 1, 2017 at 4:06 pm #802627Thank 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, 6 months ago by royaltask.
June 5, 2017 at 7:58 pm #804113Hi,
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 itfunction 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 -
AuthorPosts
- You must be logged in to reply to this topic.