Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
November 24, 2022 at 2:48 pm #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
November 25, 2022 at 8:06 am #1373828Hey 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,
IsmaelNovember 26, 2022 at 6:19 am #1373928Thanks Ismael,
that works great!
Best regards!
Tobias
November 26, 2022 at 10:25 pm #1373992Hi,
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 -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Clickable Tab Section’ is closed to new replies.