Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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

    #1332085

    Hey 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,
    Ismael

    #1332120
    This reply has been marked as private.
    #1332183

    Hi Ismael, I solved it. I restored the original “tab_section.php” file and everything works.

    Thanks for the support

    #1332256

    Hi,

    Great! Glad to know that it is working. Please do not hesitate to open another thread if you need anything else. We will close this one for now

    Have a nice day.

    Best regards,
    Ismael

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘tab section with catalogue’ is closed to new replies.