-
AuthorPosts
-
March 2, 2017 at 4:06 pm #754393
Hey guys,
Thanks for the great 4.0 Update. I have one question regarding the new tab section. Is it possible to open a tab from a Link?
I have a Image with Hotspots in every Tab and I want to link the Hotspots to the individual tabs.Thanks a lot for your help.
Regards Martin
March 7, 2017 at 9:19 pm #757263Hey Martin,
Sorry for the late response, I’m not really sure what you meant but there’s no option for links in tabs, but if it’s a link you just click and open for example the 2nd tab, it should be possible by using this url pattern:
http://domain.com/mypage/#tab-id-2
Hope this helps.
Best regards,
NikkoMarch 16, 2017 at 1:29 pm #761877Hey Nikko,
Thanks for your reply. Yes this works for normal tabs but nor for the new Tab Section.
There is no URL Parameter to change the tabs.Thanks for your help.
Regards Martin
March 20, 2017 at 7:06 am #763509Hi,
Please follow the instructions here:
// https://kriesi.at/support/topic/different-layout-for-blog-layout-and-certain-category-layout/#post-624419
// https://kriesi.at/support/topic/linking-to-filtered-portfolio-ajax/#post-430830For the tab, this script should work:
// auto trigger add_action('wp_footer', 'ava_custom_script'); function ava_custom_script() { ?> <script> (function($){ function getQueryParams(qs) { qs = qs.split("+").join(" "); var params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g; while (tokens = re.exec(qs)) { params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); } return params; } var $_GET = getQueryParams(document.location.search); $(window).load(function() { switch($_GET['tabsort']) { case '1': $('a[data-av-tab-section-title="1"]').trigger('click'); break; case '2': $('a[data-av-tab-section-title="2"]').trigger('click'); break; case '3': $('a[data-av-tab-section-title="3"]').trigger('click'); break; case '4': $('a[data-av-tab-section-title="4"]').trigger('click'); break; } }); })(jQuery); </script> <?php }
The url should look something this:
http://www.mysite.com/myportfolio?tabsort=2
This will trigger the second tab.
Best regards,
IsmaelMarch 30, 2017 at 4:32 am #769274Hi Ismael,
I wanted this functionality too, however, my tab section is down the page so I needed to link to it with an anchor as well. I found it worked if I added
?tabsort=3#anchor-id
to URLs. (Just thought I would share).My question is, if I have a link/button in a tab e.g. tabsort=1 and I want to link to trigger showing another tab in that tab section e.g. tabsort=3, how do I do it without reloading the page. Essentially I would like the same functionality as clicking on the tab section navigation.
Many thanks,
NikMarch 31, 2017 at 6:18 am #769725Hey!
@Twisted Pear: Could you please provide a link to the page with the nested tabs? I think this is possible but having a tab inside another tab is not good idea because you’re unintentionally hiding the content from your users. Be mindful of the Three-click rule when designing your content.
Best regards,
IsmaelMarch 31, 2017 at 6:34 am #769729Hi Ismael,
Sorry, I don’t want to nest tabs, I simply wish to have a button that promotes to a particular tab in that tab section.
I have provided a link.
Please click on “Find a Technical Essentials Class” to see what I have done as a workaround.
I would prefer it would just promote to the “Schedule” tab rather than reloading the page and then going to it.Many thanks,
NikMarch 31, 2017 at 6:53 am #769737Hey!
Remove the link or href value of the button then add a unique class attribute to it. Use the button to trigger the “Schedule” tab title. Something like this:
function b() { $('.customcssforthebutton a').on('click', function(e) { e.preventDefault(); $('a[data-av-tab-section-title="3"]').trigger('click'); }); } b();
Regards,
IsmaelMarch 31, 2017 at 7:28 am #769745Hi Ismael,
That did it.
Consider topic closed.Many thanks,
NikApril 2, 2017 at 8:07 am #770529 -
AuthorPosts
- The topic ‘Link to Tab in Tab Section’ is closed to new replies.