-
AuthorPosts
-
October 5, 2020 at 3:20 pm #1250606
I’m building a website using your wonderful theme. I really love it, but I have a problem with tab section. The site is https://croissant.grachev.eu
Take a look at the image:
The section has 3 tabs, the 1st one is open by default. When I click on any other tab, it opens and I see its URL in my browser’s address bar. When I copy this URL and paste it in another browser (or another browser’s window/tab, doesn’t matter) — looks like it opens the correct tab, but doesn’t scroll to that tab. Instead of it, the site opens from the very beginning. Hope you understand what I mean.
And problem #2 — I can’t access tabs from the menu, the links don’t work at all. :(
I have tried all the “solutions” I could find in this forum, but none works for me. I can give you access to the admin area, to the FTP — anything you need. Please help me!
- This topic was modified 4 years, 2 months ago by grabowski.
October 7, 2020 at 9:25 am #1251063OK, this code helps (more o less) to scroll to the desired tab:
function custom_id_script(){ ?> <script> (function($){ $(document).ready(function(){ $("a.av-section-tab-title").each(function() { var $this = $(this); var _href = $this.attr("href"); var itemId = _href.substring(1, _href.length); $this.attr("id", itemId); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_id_script');
The URL in the address bar changes, but the tab itself doesn’t open.
Any ideas please?October 9, 2020 at 2:43 pm #1251718What a wonderful support forum! Anyone is going to help me???
October 12, 2020 at 6:08 am #1252181Hi,
We are very sorry for the late response. The following snippet should make the page scroll to the tab section when the anchor is the same as one of the tab section titles. Please add it 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 12, 2020 at 9:55 am #1252219Ismael, thank you for your response!
No, it doesn’t work. Moreover, when with this snippet, the menu remains open.
October 15, 2020 at 7:58 am #1252937Hi,
Thank you for the update.
Did you remove your custom script after adding the recommended snippet? Please post the login details in the private field so that we could check the script further.
Best regards,
IsmaelOctober 15, 2020 at 9:32 am #1252958Yes, I removed that “custom” script. Without that script it works even worse than with it.
But the most important thing is that at the top of the page there’s a canvas animation. So I need to place links to the tabs inside this animation. I’d like to have some “universal” script to do that.
Admin details are in the private content.
October 19, 2020 at 12:42 pm #1253937Hi,
Thank you for the update.
We added the script again and it seems to be working properly on our end. The page scrolls to the tab section and open the appropriate content. Please try to remove the browser cache and hard refresh the page, or check it incognito mode.
Best regards,
IsmaelOctober 19, 2020 at 1:08 pm #1253953It still doesn’t work. Anyway, thank you for the attempt to help me with this trouble.
You should add this feature by default in your next updates. Sometimes it’s very necessary.- This reply was modified 4 years, 2 months ago by grabowski.
October 22, 2020 at 3:15 am #1254797Hi,
That is odd. It does work properly on our end, with or without the previous script that you created. Did you remove the browser cache or history, or hard refresh the page?
Best regards,
IsmaelOctober 27, 2020 at 2:54 pm #1256084Yes, I did everything. I even tried it in 5 different browsers.
November 3, 2020 at 4:31 am #1257860Hi,
Sorry for the delay. Which browser are you using? We are testing the page on Firefox Windows 10 and the script is working as expected. It scrolls to the tab section and open the appropriate tab when clicking on the menu item, or when an anchor exists after loading a page.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.