Tagged: x
-
AuthorPosts
-
October 17, 2016 at 9:51 am #1219402
white-forestParticipantHi,
im trying to add a link to an specific tab, i tried several methods i found in the forum but no one of them is working for me,
i tried to add a code to the custom-js and added the class: link_to_tab but it didn’t worked.
Any ideas for my website ?Greets Felix
October 17, 2016 at 10:07 am #1219438
RahulModeratorHey There,
Thanks for writing in!
To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
October 17, 2016 at 10:16 am #1219453
white-forestParticipantThis reply has been marked as private.October 17, 2016 at 10:18 am #1219455
white-forestParticipantAnother Question i got is the button in the header i can’t align it, so it fits to the links in the navbar.
October 17, 2016 at 11:19 am #1219533
JoaoModeratorHi There,
Please watch this link rgarding the first question.
Regarding the button on the navbar, please add the following code to Appereance > Customizer > Custom > CSS
li.menu-item-868 { margin-top: -10px; }Hope it helps
Joao
October 18, 2016 at 3:25 am #1220480
white-forestParticipantHi !
I already tried the method and code from your link but that didn’t worked, i have no idea why.Your css code is working for the button, thanks a lot !
October 18, 2016 at 4:02 am #1220520
LelyModeratorHi There,
Please remove the class link_to_tab from your menu link. That was just needed when using a button on the same page and linking to specific tab. Normal link will work as long as href value was added correctly. Try again after removing the class.
October 18, 2016 at 4:20 am #1220541
white-forestParticipantAwesome , thank you Lely it is working now !
Thanks for the great support , greets from Germany !October 18, 2016 at 4:33 am #1220553
white-forestParticipantI’ve got one more question , if i’m on the page with the tab and hit the navbar link , nothing happens . If i’m on another page it works fine.
Any Ideas how to solve that problem ?October 18, 2016 at 5:11 am #1220588
LelyModeratorHi There,
You’re welcome!
In that case, please add the class link_to_tab back on the menu but then we need to update the code to this:/* Open Tab from Link */ jQuery(function($){ $(document).ready(function() { var tabnum = location.href.split("#").slice(-1)[0] ; x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]') ); }); $('.link_to_tab > a').click(function(e){ e.preventDefault(); var tabnum = $(this).attr('href'); x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]')); }); }); function x_scroll_to_tab($, tab_nav) { $(tab_nav).click(); $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing'); }The problem on the previous code is that the class is added on list tag of the menu and not directly on the link tag. We have to update the code to look for the link tab now.
Please also update the link. #x-section-2/ is not needed on the href value.Hope this helps.
October 18, 2016 at 7:38 am #1220738
white-forestParticipantThank’s you’re awesome , works perfect! Again thanks for the great support !
October 18, 2016 at 8:07 am #1220773
white-forestParticipantI’m really sorry but i’ve got another problem now 😀 I’ve got 2 tables on my page , and i tried to use the same method with link_to_tab but when i’m on one of the two tables i can’t navigate to the other table with the links. Instead of that the links from the other table control the actual table i’m one.
October 18, 2016 at 10:46 am #1220977
LelyModeratorHi There,
Please update the code to this:
/* Open Tab from Menu Link */ jQuery(function($){ $(document).ready(function() { var tabnum = location.href.split("#").slice(-1)[0] ; if(location.href.indexOf("#tab-") > -1){ x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]') ); } }); $('.link_to_tab > a').click(function(e){ var current_url = location.href.split("#").slice(0)[0] ; var current_link = $(this).attr('href').split("#").slice(0)[0]; if(current_url == current_link){ e.preventDefault(); var tabnum = $(this).attr('href'); x_scroll_to_tab($, $('.x-nav-tabs .x-nav-tabs-item a[data-cs-tab-toggle="' + tabnum.split("-").slice(-1)[0] + '"]')); } }); }); function x_scroll_to_tab($, tab_nav) { $(tab_nav).click(); $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 )},700 ,'swing'); }Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1219402 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
