Tabs module: link a tab's label instead of revealing the content

Here’s how to open a new location when clicking a specific tab of a Tabs module (the last one in the example below).

It will prevent the clicked tab to reveal its content (module’s default behavior) and change the window location.

You can add this snippet in BB Tools > Layout CSS/JS > JS or other JS place on the site.

jQuery(document).ready(function($) {
        $(".my-custom-class .fl-tabs-label:last-child")
            .off()
            .click(function(e) {
                e.preventDefault();
                window.location.href = 'https://www.domain.com';
            });
});

Thanks to @pross for the snippet debugging! :wink:

1 Like