Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1373760

    Hi Support,

    we try to make a tab section clickable – but doesn´t find a solution. How can we get this?

    Thanks for your help!
    Best regards!

    Tobias

    #1373828

    Hey Tobias,

    Thank you for the inquiry.

    Are you trying to open the tab section items using the image above the tab section? Adding this script in the functions.php file should help.

    
    // custom script
    // scroll to active tab section
    function ava_custom_script_tab_section_scroll() {
        ?>
        <script type="text/javascript">
        (function($) {
            function av_trigger_scroll_to_tab(s, e,) {
                $(s).on(e, function(event) {
                    var load = e == 'load';
                        loc = load ? window.location.hash : $(this).attr('href'), 
                        hash = load ? loc : 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).animate({scrollTop: pos.top - 100});
                        }, 300 );
                    }
                });
            }
            
            $(document).ready(function() {
                var tabs = $('.av-tab-section-container');
    
                if(tabs.length == 0) return;
    
                av_trigger_scroll_to_tab( 'area', 'click' );
                av_trigger_scroll_to_tab( window, 'load' );
            });
        })(jQuery);
        </script>
        <?php
        }
        add_action( 'wp_footer', 'ava_custom_script_tab_section_scroll', 9999 );
    

    Best regards,
    Ismael

    #1373928

    Thanks Ismael,

    that works great!

    Best regards!

    Tobias

    #1373992

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Clickable Tab Section’ is closed to new replies.