Tagged: x
-
AuthorPosts
-
October 6, 2016 at 9:38 pm #1206198
Brian HParticipantIve seen several posts about linking to a specific tab, is there a definitive answer on this?
I want to have a link on the same page that links to an open tab.October 6, 2016 at 10:29 pm #1206264
Prasant RaiModeratorHello Brian,
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.
Thanks.
October 10, 2016 at 9:38 am #1209998
Brian HParticipantMy url is http://dukeblogger.com
the url with the tabs is : http://vvoice.staging.wpengine.com/test-products/
October 10, 2016 at 12:48 pm #1210231
RupokMemberHi there,
Thanks for writing back. That’s the best solution for your case – https://community.theme.co/forums/topic/open-accordion-from-link/#post-65132
Cheers!
October 10, 2016 at 2:39 pm #1210393
Brian HParticipantHey there I tried this solution but it didnt seem to work:
October 10, 2016 at 11:18 pm #1210876
RupokMemberWould you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
October 11, 2016 at 8:22 am #1211397
Brian HParticipantThis reply has been marked as private.October 11, 2016 at 8:54 pm #1212380
LelyModeratorHi Brian,
Thank you for the credentials. There’s an update in the structure of the tab that’s why the code is not working anymore. I 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').click(function(e){ e.preventDefault(); 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'); }It is working now. See this:http://screencast-o-matic.com/watch/cD6lVMj4gp
Cheers!
October 11, 2016 at 9:25 pm #1212405
Brian HParticipantThe issue I’m having is that when you click on the learn more buttons it doesnt work, it works in the nav bar but I want the 4 learn more buttons to go to the open tabs.
October 12, 2016 at 5:46 am #1212754
LelyModeratorHi Brian,
Thank you for the clarification. I update the code to this:
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] + '"]') ); }); $('.enable_jump_to').click(function(e){ var tabnum = $(this).attr('href'); e.preventDefault(); 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'); }See this:http://screencast-o-matic.com/watch/cD6l6Ej4sy
Add the href value for the button under statevoice and localvoice button for it to work there.Hope this helps.
October 12, 2016 at 6:18 am #1212782
Brian HParticipantTHANK YOU!! you guys are the best!!
October 12, 2016 at 11:55 am #1213208
JoaoModeratorGlad to hear we managed to help,
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1206198 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
