-
AuthorPosts
-
December 7, 2021 at 6:17 pm #1331891
Hi Kriesi,
I’m looking for a solution to create a restaurant menu in open and close mode, example: https://gucciosteria.com/en/florence/menu/wine-list/. In the accordion I want to insert the catalog element, in order to modify it and add it easily, I excluded shortcodes. I am trying to modify the tab section element, see link, I have modified the file “tab_section.php” by setting the initial opening to 0. Now I would like to give the user the possibility to close the tab by clicking on the tab title. How can I do? Can you recommend a different solution?Thanks in advance
December 9, 2021 at 10:00 am #1332085Hey vbonora,
Thank you for the inquiry.
You can try using this script in the functions.php file to close the active tab section content after clicking on an active tab title.
// a custom script function ava_custom_function_script(){ ?> <script> (function($) { $(document).ready(function() { $(".av-tab-section-container .av-section-tab-title").on("click", function(e) { var clicked = $(this); var id = clicked.data("av-tab-section-title"); var container = clicked.parents(".av-tab-section-outer-container"); var tab = container.find(".av-layout-tab[data-av-tab-section-content='"+ id +"']"); var tab_inner = container.find(".av-layout-tab-inner"); if (tab_inner.css("height") != "0px") { setTimeout(function() { clicked.removeClass("av-active-tab-title"); container.find(".av-tab-section-inner-container").css("transform", "translate3d(0%, 0px, 0px)"); container.find(".av-active-tab-content").removeClass("av-active-tab-content"); $(tab_inner).css("height", "0px"); }, 300); } }); }); } )(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_function_script');
Best regards,
IsmaelDecember 9, 2021 at 1:28 pm #1332120This reply has been marked as private.December 9, 2021 at 6:40 pm #1332183Hi Ismael, I solved it. I restored the original “tab_section.php” file and everything works.
Thanks for the support
December 10, 2021 at 10:12 am #1332256 -
AuthorPosts
- The topic ‘tab section with catalogue’ is closed to new replies.