Streaming live at 10am (PST)

Linking to a specific tab from a button link


#1

Hi there.

I would like to know if you and your team can help me with an issue, please, with the site: http://ibtemplate.webflow.io:
1) On the jobs page, for exemple: http://ibtemplate.webflow.io/jobs/usability-and-interaction-designer, we have “Jobs” button.

2) Clicking on the button I would like to link to a specific tab on http://ibtemplate.webflow.io/work-with-us. So, I would like to have active the “Jobs” tab to show all the jobs.

It´s going now to:

But I would like to go to this way and I don´t use as default the “Jobs” tab.

Kind regards.


Linking a button to a tab
#2
  1. Create individual classes for all your tabs

  2. Put the code below into Site Settings > Custom Code > Footer Code:

    <script>
    function getParam(name) {
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        var results = regex.exec(location.search);
        return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    var Webflow = Webflow || [];
    Webflow.push(function () {
        var tabName = getParam('tab');
        if (tabName) $('.' + tabName).triggerHandler('click');
    });
    </script>
  3. Append this to the href/URL on the button you are linking from

    /pagename?tab=tabclass

    Replace pagename and tabclass with slug of the page that the tabs are in. eg. If the tabs are in the 'about' page and you want to link to the 2rd tab with a class of 'secondtab', then;

    /about?tab=secondtab

Hope this helps. This topic was discussed here;


What is the direct link to a tab that is not an active tab on that page?
Linking to a specific tab from a button on another page
Accessing tabs from address bar
#3

Thank you so much @AlexManyeki!
Perfect!


#4

This topic was automatically closed after 60 days. New replies are no longer allowed.