-
AuthorPosts
-
January 15, 2018 at 10:56 am #897466
Hi :)
Is there a way to change to change the open tab via the main menu?
The link in the menu is URL/site1/#tab-1
When I’m on a different page it opens the page with the correct tab open, but when I’m already on the page URL/site1/ and then click on the link URL/site1/#tab-2, the open tab doesn’t change.
Is there any way to achieve that?Thanks!
PeterJanuary 15, 2018 at 12:47 pm #897493Hey aditive,
To link to a tab from the same page try formating your link like this:http://yoursite.com/page#tab-1
Best regards,
MikeJanuary 17, 2018 at 2:32 pm #898480Hi Mike :)
sorry for my late reply. I don’t seem to get messages for updated threads.
That’s how I link to the tabs already.
Any other ideas?
Thanks!
PeterJanuary 17, 2018 at 5:06 pm #898543can not confirm this – on my installation – even if on top in the url window a different tab is opend-
i can open the another tab even over menu link.By the way this to functions.php of your child-theme – to have customised tab hashes:
add_theme_support('avia_template_builder_custom_tab_toogle_id');
January 17, 2018 at 9:36 pm #898683Hi,
Sorry, I didn’t find your direct link to a tab in your main menu. I do see the tabs in the url you added. Please advise.Best regards,
MikeJanuary 19, 2018 at 12:52 pm #899644Papiermaschinen -> Poperoller -> Beschichten -> HKV 76 or TC 401
Thanks!
Again sorry for the delay. same as before :)January 19, 2018 at 1:38 pm #899684Hi,
I added this code to the end of your functions.php file in Appearance > Editor:// 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('#')); } 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 ) }, 1000 ); } }); } scrollToTab( '.menu-item a', 'click' ); scrollToTab( window, 'load' ); })(jQuery); </script> <?php }
and the links seem to work correctly now, Please clear your browser cache and check.
Best regards,
MikeJanuary 20, 2018 at 11:51 am #900066Awesome, thanks! Works perfectly now :)
January 20, 2018 at 3:51 pm #900109 -
AuthorPosts
- The topic ‘Change open tab via Main-Menu’ is closed to new replies.