-
AuthorPosts
-
October 6, 2020 at 2:31 pm #1250859
Hi,
I have a problem on this page: https://leagrowingpeople.com/who-we-are/if I enter “our story” from the main menu I can enter.
But if I am already on the “Who we are” page, for example in the first tab “our team”, and I want to go to “our story” from the main menu, I can’t access, why? That is, if I am already inside the “who we are” page and I want to move using the main menu to go from one tab to another I cannot do it.I also add a video to better explain: https://monosnap.com/file/pf0jZRJFtWvvFFP1qXzrz7mZwuB4RF
I hope the problem is cleared up.
Thanks for your continued support,
ManuelaOctober 12, 2020 at 5:53 am #1252179Hey Manuela,
Thank you for the inquiry.
What you are looking for is possible but we have to use an additional script to open the appropriate tab section when a corresponding menu item is clicked. Please add snippet in the functions.php file.
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( '.av-active-burger-items a', 'click' ); scrollToTab( window, 'load' ); })(jQuery); </script> <?php }
Best regards,
IsmaelOctober 13, 2020 at 5:39 pm #1252576Hi,
I entered the function, but when I enter the 2 or 3 tab it takes time to go to that tab.
Why?
This is the link https://leagrowingpeople.com/ and the menu item to try is “Who we are” tab 2 “our methods”.
Thanks for the support,
ManuelaOctober 19, 2020 at 5:54 am #1253790Hi,
Thank you for the update.
It does not go immediately because it waits for the window or the page to load. Try to decrease the timeout duration in this block.
setTimeout( function() { $(window).scrollTop( pos.top - 100 ) }, 1000 );
Replace 1000 with 100 ms to decrease the wait. It will still have to wait for the page to completely load though.
Best regards,
IsmaelOctober 19, 2020 at 8:23 am #1253846Hi,
yes, it works for the time.
But it not work if I’m already in the page try please: https://leagrowingpeople.com/who-we-are/
Thank you for your support,
Manuela- This reply was modified 4 years, 1 month ago by famarinu.
October 20, 2020 at 9:52 am #1254287Hi,
We found a minor syntax error in the script and adjusted it a bit. It should be working properly now. Please purge the cache and remove the browser history prior to checking the page, or use incognito mode.
Thank you for your patience.
Best regards,
IsmaelNovember 5, 2020 at 8:45 pm #1258724Hi,
now in this page: https://leagrowingpeople.com/who-we-are/ it works.
Thank you for your support,
Manuela- This reply was modified 4 years ago by famarinu.
November 9, 2020 at 2:45 am #1259154 -
AuthorPosts
- The topic ‘menu and tab section’ is closed to new replies.