-
AuthorPosts
-
January 27, 2015 at 10:07 pm #193142
timewarp23ParticipantI want to link to specific tabs from the megamenu.
In this example from the services drop down you can go to specific tabs
http://laumont.com/index.htmlHere is the X theme I am working on.
http://laumont.com/NEWSITE/scanning/
currently only scanning is up. I am trying to link to
http://laumont.com/NEWSITE/scanning/#tab-3Also, I am getting random red borders when I click on the tab navigation.
January 28, 2015 at 3:10 pm #193755
Nabeel AModeratorHi there,
Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.
January 28, 2015 at 6:26 pm #193895
timewarp23ParticipantWell, I did provide an example
In this example from the services drop down you can go to specific tabs
and here is the X theme I am working on
Here is the X theme I am working on.
http://laumont.com/NEWSITE/scanning/
currently only scanning is up. I am trying to link to
I have a Tabbed content section on the “scanning” page. From the Main Navigation (megamenu) I want to be able to link to specific tabs. i.e.: Click on Cruse Scanning from the main nag and go to scanning page with Cruse Scanning tab as active.
You also did not address the red boxes that appear on the Tab Nav when clicked.
January 29, 2015 at 3:25 pm #194644
RadModeratorHi there,
Thanks for writing in.
That’s possible, add this code at customizer’s custom javascript under Admin > Appearance.
jQuery( function($){ $( document ).ready( function(){ scroll_to_tab ( location.href.split("#").slice(-1)[0] ); }); $('a.link_to_tab, .link_to_tab a').on( 'click', function( e ){ var window_base = location.href.split("#").slice(0)[0]; var url_base = $( this ).attr('href').split("#").slice(0)[0]; if ( window_base == url_base ) { scroll_to_tab ( $( this ).attr('href').split("#").slice(-1)[0] ); e.preventDefault(); } }); function scroll_to_tab ( tab_id ) { var tab_nav = $('.x-nav-tabs .x-nav-tabs-item a[href="#' + tab_id + '"]'); if(tab_nav.length >=1) { $( tab_nav ).trigger('click'); $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 ) },700 ,'swing');} } });Since, we can’t enable tab linking to all of your menu items. Then you can selectively add link_to_tab at any menu item’s css class attribute. If you can’t find your menu item’s class attribute, then please enable it at “Screen Options” on top of your page.
Hope this helps.
January 29, 2015 at 4:29 pm #194724
timewarp23ParticipantHmmm… still does not work.
I have toggled the first tab and tab nav as active and not, and it did not work.
I have all menu items under scanning with the class of link_to_tab.January 29, 2015 at 4:33 pm #194729
timewarp23ParticipantThis reply has been marked as private.January 30, 2015 at 1:59 pm #195467
RadModeratorHi there,
Please check. Added small fix to the code.
Cheers!
February 2, 2015 at 8:13 am #197184
timewarp23Participantfantastic! thanks!
What was the code change? I like to keep records for the future.February 2, 2015 at 10:17 am #197311
ZeshanMemberYou’re welcome! 🙂
The updated code is:
jQuery( function($){ $( document ).ready( function(){ scroll_to_tab ( location.href.split("#").slice(-1)[0] ); }); $('a.link_to_tab, .link_to_tab a').on( 'click', function( e ){ var window_base = location.href.split("#").slice(0)[0]; var url_base = $( this ).attr('href').split("#").slice(0)[0]; if ( window_base == url_base ) { scroll_to_tab ( $( this ).attr('href').split("#").slice(-1)[0] ); e.preventDefault(); } }); function scroll_to_tab ( tab_id ) { var tab_nav = $('.x-nav-tabs .x-nav-tabs-item a[href="#' + tab_id + '"]'); if(tab_nav.length >=1) { $( tab_nav ).trigger('click'); $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 ) },700 ,'swing');} } });Cheers!
March 24, 2015 at 1:11 pm #234222
jozhicaParticipantFollowing on this topic how do I link to a specific tab from the other tab content?
I need a “Book” that is located in every tab content link to got to Book tab which is #tab-5 on the same page.
[tab_nav type=”seven-up”]
[tab_nav_item title=”Overview” active=”true”]
[tab_nav_item title=”Itinerary” active=””]
[tab_nav_item title=”Inclusion” active=””]
[tab_nav_item title=”Dates/Prices” active=””]
[tab_nav_item title=”Book” active=””]
[tab_nav_item title=”Contact Us” active=””]
[tab_nav_item title=”Reviews” active=””]
[/tab_nav]
[tabs][tab] Content Overview
[button shape=”square” size=”mini” float=”none” info=”none” info_place=”top” info_trigger=”hover” href=”#tab-5″]Book[/button]
[/tab][tab] Content Itinerary
[button shape=”square” size=”mini” float=”none” info=”none” info_place=”top” info_trigger=”hover” href=”#tab-5″]Book[/button]
[/tab]This is what I have but the tab is not opening.
When I click on the button the url shows the full link …/portfolio/test/#tab-5 but the tab doesn’t change.March 24, 2015 at 5:00 pm #234412
John EzraMemberHi Jozhica,
Thanks for writing in! There might be something conflicting, but we can’t be sure until we check the site. To assist you with this issue, would you mind providing us with your URL. This is to ensure that we can provide you with a tailored answer to your situation.
In the meantime could you try seeing if a link (not within a tab) works pointing to a specific tab? This is so we can see if the issue is within the tab. Thanks!
March 24, 2015 at 5:34 pm #234431
jozhicaParticipantThis reply has been marked as private.March 25, 2015 at 6:23 am #234744
ZeshanMemberHi there,
Thanks for writing in!
Upon checking, I’m not seeing the provided following JS code in your website:
jQuery( function($){ $( document ).ready( function(){ scroll_to_tab ( location.href.split("#").slice(-1)[0] ); }); $('a.link_to_tab, .link_to_tab a').on( 'click', function( e ){ var window_base = location.href.split("#").slice(0)[0]; var url_base = $( this ).attr('href').split("#").slice(0)[0]; if ( window_base == url_base ) { scroll_to_tab ( $( this ).attr('href').split("#").slice(-1)[0] ); e.preventDefault(); } }); function scroll_to_tab ( tab_id ) { var tab_nav = $('.x-nav-tabs .x-nav-tabs-item a[href="#' + tab_id + '"]'); if(tab_nav.length >=1) { $( tab_nav ).trigger('click'); $('html,body').animate({scrollTop: $(tab_nav).offset().top - ( $('.x-navbar').height() + 50 ) },700 ,'swing');} } });It seems you are using a caching plugin (see: http://prntscr.com/6l4e66). I’d recommend that you clear it, and disable during development. This can cause Customizer changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.
Thanks!
March 25, 2015 at 10:09 am #234922
jozhicaParticipantIs this correct for the button?
[button shape=”square” size=”mini” float=”none” info=”none” info_place=”top” info_trigger=”hover” href=”#tab-5″ class=”link_to_tab”]Book[/button]
March 25, 2015 at 3:02 pm #235133
ZeshanMemberHi there,
Yes, that’s correct. Upon checking, the “Book” link is working for me now. Glad to see that 🙂
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-193142 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
