Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
You can close this.
Best regads
EmanuelHey,
I fixed the code from Ismael by my self.
https://kriesi.at/support/topic/tab-section-link-from-content-in-one-tab-to-another-tab/#post-909792
I did it this way:// custom script add_action( 'wp_footer', 'ava_custom_script_tab_section' ); function ava_custom_script_tab_section() { ?> <script type="text/javascript"> (function($) { function scrollToTab(s, e,) { $(s).on(e, function(event) { var anchor, loc, cur, hash, tab, parent, pos; if( e == 'load' ) { loc = window.location.hash; hash = loc; } else { loc = $(this).attr('href'); hash = loc.substring(loc.indexOf('#')); } if(hash!=''){ tab = $('.av-section-tab-title[href='+ hash +']'); parent = tab.parents('.av-tab-section-outer-container'); pos = parent.offset(); tab.trigger('click'); if(hash) { setTimeout( function() { $(window).scrollTop( pos.top - 100 ) }, 500 ); } } }); } scrollToTab( '.menu-item a', 'click' ); scrollToTab( window, 'load' ); })(jQuery); </script> <?php }I put an if-clause around the jumping part, which prevent the error.
if(hash!='')
Best regards and thanks for your idea.Emanuel
Hello Mike,
Yes I use this Code Snippet to jump directly to the opened Tabs.
Best regards
Emanuel -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
